Questions tagged as 'swing'

2
answers

Button does not work when code is added to AbstractTableModel

I created a test project to implement in a larger project of a table with a button as one of the elements of the row. It works perfectly, but when I try to add to my code the button does not perform the action that was programmed. It is being do...
asked by 30.10.2018 / 17:31
1
answer

Put array of objects in comboBox

I have the following method to add objects to a JComboBox : public void PopulaCategoria() throws SQLException{ for(Categoria categoria : caDAO.getCategorias()){ comboCategoria.addItem(categoria); } } But...
asked by 04.05.2018 / 18:54
1
answer

Program works by debugging but not executing

I'm making a game of the old one and I wonder if the tight button I set up in class MenuPrincipal is returning the correct value for the main class that controls the change between windows. Running the program normally does not work, b...
asked by 09.03.2018 / 12:18
1
answer

Doubt regarding the dispose () and repaint () methods

What is the function of .dispose() and repaint() methods in using Graphics in Java?     
asked by 12.03.2018 / 03:34
1
answer

Fix JButton that is running 2 events

I have an application where in a JFrame I create new records for a mysql table, and in another I return a select in a JTable with all records created. I have a button change, which when I select a line from JTable and click on it, open...
asked by 10.06.2018 / 14:54
1
answer

Arrange labels vertically

I wanted to put panels in specific positions, so I tried combining some layout managers, but I still have not got the result I need. I tried to use gridLayout , so components would not be stretched, but I'm not sure if I'm making a bad...
asked by 01.04.2018 / 21:58
1
answer

The text file does not appear completely in JTextArea

I put it to show the packages, so you can tell me if I'm making the correct use of MVC If I save in txt: [Maria;32] ; [Joao;44] e [Luna,12]' It only shows me Nome: Maria Idade 32 and Nome Joao , the rest it ignores.    C...
asked by 18.12.2017 / 05:42
1
answer

Change label color according to screen status

I'm having trouble changing the color of the content of a label, according to the state of my screen (enabled / disabled). I would like to know how I can to make it change the color. I made a very simple example (without worrying about the...
asked by 21.04.2017 / 19:56
1
answer

Separate street address from a string

In my application JAVA , on a screen, I have fields related to the address, I have two ways to register this address, I can automatically pick up the zip code most of the information or put everything "manually" p> The problem is that ma...
asked by 27.04.2017 / 19:03
1
answer

Treat empty field even containing spaces

I made a temperature converter from Celsius to Fahrenheit, I'm trying to treat if the JTextField is different from 0, display the temperature in fahrenheit, but 0.0 appears until empty, with spaces inserted in that field. @Override...
asked by 19.02.2017 / 22:06