Questions tagged as 'swing'

1
answer

JFrame by repeatedly opening twice

I'm new to programming for desktop, well, I'm doing a program in java using swing and sqlite database, I already did some things work, but after login the jframe that should open a single opens twice, how to fix this? Follow the coidigo pr...
asked by 31.12.2015 / 03:26
1
answer

Doubt about updating JLabel in JFrame

Why can not I update my labelHora in Frame ? Using a print after the line labelHora.setText(x); I noticed that the content of labelHora changes, but the screen continues the default, which in this case is "zzz". package ultili...
asked by 02.12.2015 / 05:51
1
answer

JTree does not update when starting GUI

I have a problem that I can not see the solution: Simply put, my Java program has a swing GUI that contains a JTree (TreeModel custom for system directory view) There is a button to select a directory (via JFileChooser), after selecting JTree...
asked by 14.12.2015 / 16:18
1
answer

Several buttons (JButton) with the same function in different JPanels

I'm doing a program (using the NetBeans GUI Builder and CardLayout) with several screens (various JPanels) and all of them will have a start button, which obviously returns to the home screen. I want to leave the code cleaner, so I created a...
asked by 18.10.2015 / 03:49
1
answer

Always focus on JFrame

I need when I click on any button in my application the focus will return to JFrame . Is there any method for this? I could call the MeuFrame.requestFocus() method on every ActionPerformed , but this would take a long time....
asked by 13.07.2015 / 20:24
1
answer

How to use "drawRect" to draw on a component?

I'm learning Graphics , but I can not make a square: public static void main(String[] args) { JFrame tela = new JFrame("Snake"); tela.setSize(500, 500); tela.setVisible(true); Graphics g = tela.getGraphics();...
asked by 03.09.2015 / 16:40
2
answers

How to remove the border of text in a component?

I have a program in Java and would like to remove these borders that appear in the button text: (The red borders were in the edition the ones I want to remove are those dark blue inside the red ones)     
asked by 02.09.2015 / 22:57
1
answer

Refresh Jframe [closed]

I made software to monitor servers I have Jframe with several buttons where these are one color (green if server is online and red otherwise). I run this test using ping . When I click the button to open this frame, all buttons are...
asked by 29.05.2015 / 15:43
1
answer

Dynamically update (refresh) a JDialog (swing)

I'm having some trouble updating JDialog created through WindowsBuilder in Eclipse (it would not be because of this). Basically, I have a Change Registrations screen from my financial mini-system, I load the information on t...
asked by 15.04.2015 / 03:44
1
answer

Button does not appear in window

My button called btnLimpar does not appear. This is the code: import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class Frame extends JFrame { private JButton btnEnviar...
asked by 24.03.2015 / 21:12