Questions tagged as 'swing'

1
answer

How do I set a jcombobox in a PreparedStatement?

How do I make a jcombobox in this method? The Combobox would be in the type that the user is supposed to choose, I tried to make one but it did not work very well. And this method is in my main class and how do I set it to a PreparedStatement...
asked by 29.06.2015 / 22:57
1
answer

JScrollPane track the component that is focused

I have a screen with JSrollPane and several JTextFields . When changing textfield using the tab key, JScrollPane does not match if the textfield that receives the focus is "down the screen." I wanted it when I shifted th...
asked by 12.12.2018 / 13:48
1
answer

Problem when performing a button event in Java Swing

I have a problem making an event on a button (using textfield to set values) and calling a method to calculate the IMC (I have not yet finished this method). Code: (screen.java) package calculadoraimc; import javax.swing.*; import java.awt....
asked by 21.11.2018 / 11:06
1
answer

Problems with paging in JTable

I am creating an application where I fill in the data from a table through the database, but there are many then wanted to organize better. However, the results displayed in the table are not constants. The implemented methods behave differen...
asked by 28.10.2018 / 21:59
1
answer

Problem in displaying results in label in java [closed]

package cursoemvideo; /** * * @author DANIEL */ public class TelaCalculadora extends javax.swing.JFrame { /** * Creates new form TelaCalculadora */ public TelaCalculadora() { initComponents(); pnpPainel.set...
asked by 18.09.2018 / 19:12
1
answer

Select all JCheckboxes when clicking button

My application has a list of JCheckBox within a Box . I want to make a button to mark all of them, but my code is giving the following error when I click the    "java.lang.RuntimeException: Uncompilable source code - Erroneous sy...
asked by 29.05.2018 / 14:46
1
answer

How to insert column title in a jTable?

I could not display the table title, could they help? Note: I entered "JScrollPane scroll = new JScrollPane(tabela); "and" contentPane.add(scroll); "or" getContentPane.add(scroll) "as I saw in questions / answers from that s...
asked by 18.03.2018 / 14:42
1
answer

Change the color of the JTable header

How do I change the header color of JTable that uses Nimbus Look And Fell ? I tried to use: JTableHeader header = jTable2.getTableHeader(); header.setBackground(java.awt.Color.yellow); But it did not work, it continues with the d...
asked by 08.05.2018 / 03:47
1
answer

Iterate over components Swing recursively is strange [closed]

To add Listeners to all the components of my Frame I'm iterating over it recursively: private void adicionarListeners(Component componente) { Stack<Component> stack = new Stack<Component>(); // evita adicionar...
asked by 16.03.2018 / 19:56
1
answer

The setText method does not insert the text correctly inside a repeat loop

I created a method that shows a loop of repetition, and inside it I get the product of the variable set by the counter, like a table and such. But when it arrives in TextSet, it does not show the 10 textSet that was to show, but only the last...
asked by 04.03.2018 / 03:04