Questions tagged as 'java-swing'

3
answers

Can switch be used with objects in java?

Hello very afternoon or evening ... my question is the following can you use the switches to compare objects ?? see it this way I have a window with 3 buttons, each button changes the background to a different color could the switch be implement...
asked by 03.02.2018 / 14:45
1
answer

Help with java events

Very good. I have created a fairly simple calculator in Java that works (at the moment) by pressing the buttons on the interface and I have the following questions: For some reason, there are times when pressing the buttons these do not w...
asked by 18.02.2018 / 19:24
1
answer

Help I need to read Java files

Hello! After a long wait at the end, I have to develop a small exercise with Threads. I have a set of txt files with 4 colors in RGB code (red, green, blue), each file contains the rgb colors separated by spaces and the color name: "84 84...
asked by 07.03.2018 / 05:12
1
answer

How to make different actions when pressing a button?

I have found myself in a problem when doing a Java program, and that is that as I have the code it does not matter what button I press that is always going to execute the command of button 1 I think it is because I am wrongly selecting what what...
asked by 09.01.2018 / 15:18
1
answer

Perform random on a jList

I am doing a program that performs a raffle among all the participants, they go from a JTextArea to a JList. When I click on the 'Confirm' button, I pass the text of the JTextArea to the Jlist, deleting the text that is not a name, but when I cl...
asked by 09.01.2018 / 18:56
2
answers

How to fill a field with "messages" for a chat?

I'm doing a very homemade chat. I have it connected to the BD Sql Server (for practical purposes, I know it is not viable) to save the sent messages and check them in the DBMS to verify that they are saved correctly. The problem comes here...
asked by 30.08.2017 / 07:41
2
answers

Close JFrame when I open another

I have a JFrame "1" with a button that opens another, when I press the button and the JFrame "2" opens, I want the JFrame "1" to close. I have tried to do it in the following ways: But they have not worked for me.     
asked by 21.09.2017 / 21:43
3
answers

Error in JAVA creation of arrayList incompatible types: String can not be converted to branch ----

What does the error mean and how can I solve it? It is a database of a bank in which I have to use a type "branch" but I can not use it add that type To My arrayList ArrayList Array_Asesores = new ArrayList(); Here is the code porfavorrr .....
asked by 07.12.2017 / 16:07
1
answer

Paint the rows of a JTable according to a condition - Java

I have a JTable tbDocTransfer with 17 columns full of information, what I want is to paint each row that meets the following condition: if in the first column of the JTable rows it says "E" it is painted red and if it does not say nothing is pai...
asked by 23.02.2017 / 21:21
1
answer

Export to Excel - Java

This is the code I use to export to excel: @SuppressWarnings("resource") protected void btnExportarExcelActionPerformed(ActionEvent arg0) { JFileChooser seleccionar = new JFileChooser(); File archivo; if (selecci...
asked by 12.01.2017 / 21:50