Questions tagged as 'java'

1
answer

Trigger two different events with JButton

I'd like to know how to trigger different events using the same button. What I wanted was for the next click to give jButton1.setText("Créditos"); and return to btnGerar.setVisible(true); The idea is that when I click on "Credit...
asked by 04.06.2017 / 06:14
1
answer

How to pass the Netbeans project to a .jar file?

I just did a project on Netbeans and would like to turn it into an app to run on the PC, so I want to turn it into .jar. How to do this?     
asked by 03.06.2017 / 22:07
1
answer

How to add scrollbar to a Scrollpane?

I have a panel, and I will have just fields and buttons on it. I thought about using JScrollPane to not make the screen so large. However, I'm not able to add this scrollbar. How do I add a scroll bar inside the p panel, in the sample...
asked by 02.05.2017 / 04:45
2
answers

HTTP return 0

I'm having a rather strange problem .. I need to return the status of some web addresses for the application, so I used the code below: The algorithm takes a URL as its parameter, so it returns me the HTTP status. If it's 200 , I know it'...
asked by 02.05.2017 / 15:55
1
answer

Using Media in Android Studio [duplicate]

Hello, good morning. I have an audio in the raw folder, with a few seconds of duration. I want to use this audio when the application opens. When the application is initialized, it will start with the audio playing. Does anyone help me do this...
asked by 01.05.2017 / 14:24
1
answer

How to differentiate buttons within the same event?

I'd like to know a method to differentiate a button that generated event, in my method that will handle events. In the example below I add the same class that handles events to 2 buttons, but I can not differentiate the buttons in my method...
asked by 13.05.2017 / 03:36
1
answer

What is the explanation for the following question

This is a java certification simulation issue at Whizlabs. public class Whizlabs { public static void main(String[] args) { int[] testData = {1, 2, 3}; for(abc){ } } } The question is: "Choose the option to r...
asked by 14.05.2017 / 04:10
2
answers

Generate random numbers in java, store in a vector and sort them

I need to generate 100000 numbers, store them in a vector and sort them using the BubbleSort algorithm, the error "Exception in thread" main "java.lang.Error: Unresolved compilation problem: at testaSort.main(testaSort.java:8)" Code below:...
asked by 14.05.2017 / 03:43
1
answer

Configure Log4j's appender to display in the log console from Error and save to logs file from Info

Good evening guys. I need to display in the console only logs from Error and write to logs file from Info. I have tried to use the additivity property for false, but when I use it the appender stops working and I also tried using Stackover...
asked by 23.05.2017 / 03:28
1
answer

Java - read XML from a URL

I have a function that reads XML and it works 100%, the problem is that when I try to read an XML that is online on my server I can not. Follow the code below: public int lerXml() throws JDOMException, IOException, URISyntaxException {...
asked by 23.05.2017 / 08:52