Questions tagged as 'java'

1
answer

How to set the Jbutton location to the size of a Panel

I would like to set the location of color1 to the size of a JPanel, in the same way I did with fundo public static void janelaPrincipal() { //FRAME JFrame janela = new JFrame(); janela.setDefaultCloseOperation(JFrame....
asked by 18.07.2015 / 18:59
2
answers

Error sending email with JavaMail

It was working normally. Now when I run the program the following error appears: Could not connect to SMTP host: smtp.gmail.com, port: 465; This is my method public void enviaEmail() { Properties props = new Properties(); pro...
asked by 01.04.2015 / 18:47
1
answer

Versioning of .jar in Java with Netbeans

I'd like my .jar to have a version number and release date inside it, so I could tell it on the about screen for example. So far without mystery, but the point is that with every build in Netbeans I wanted the version to be incr...
asked by 21.07.2015 / 14:36
2
answers

Set value for a cookie

I want to change a value in cookie, I am using: public static void main(String[] args) throws Exception { URL url; HttpURLConnection conn; url = new URL("http://google.pt"); conn = (HttpURLConnection) url.openConnection();...
asked by 18.08.2015 / 19:15
1
answer

I would like to find the distance in km between two markers how can I do?

I have two markers in this code and I want to find the distance in kilometers between them. private void setUpMap() { Database_Congregacao database_congregacao = new Database_Congregacao(this); int tamanho = 0; int size = 0; ta...
asked by 16.05.2015 / 00:07
1
answer

Save ArrayList to the external memory of an Android phone

How can I save an ArrayList by FileOutputStream in the memory of an android cell phone? Or do you have a better method? For example: FileOutputStream fos = openFileOutput("Foto_Imovel", Context.MODE_PRIVATE); fos.write(My_Array...
asked by 17.10.2015 / 01:46
1
answer

How to change the default font of Swing components?

I would like to know if I have to change the default of the labels fonts and Swing buttons, if possible, of the general design. All the labels that I create I have to keep changing the font to one that is bigger a bit and another style, th...
asked by 18.10.2015 / 04:03
1
answer

How to log in with slf4j from within a jboss module?

How can I log in to the console / server.log from within a jboss module? Let's say I have a class: public class MyClass { private static final Logger logger = LoggerFactory.getLogger(MyClass.class); private boolean done = false;...
asked by 19.10.2015 / 23:29
2
answers

How to keep the layout in standby mode?

Well I have two layout test_1 and layout test_2, when I turn on the picture device appears test_1 and when I turn device to landscape appears test_2, you have to leave this layout in standby (idle) so your data will not be restarted when changin...
asked by 13.03.2015 / 17:10
1
answer

How to separate a string into several in java?

My problem is basically the following, I have a JSON code that takes the data from a URL, and returns it to me (Values are in Long) 528593 444218 5693595 2466912 2466435 However, it returns this to me in a single variable (in this case, "wt...
asked by 05.03.2015 / 20:05