Questions tagged as 'swing'

1
answer

"Changing" from Jframe to JIntertalFrame [closed]

I developed the first version of my entire project using Jframes , but in the upgrade I'm doing, I decided to change all of them to a JInternalFrame . I took a look on the internet and saw that it was possible by changing the referen...
asked by 18.08.2017 / 18:40
1
answer

How to check if a JInternalFrame is already open in JDesktopPane?

How to check if a JInternalFrame is already open in JDesktopPane and, if so, put it in focus on the others? I have tried in many ways that I found searching, but always opens a new frame, even if it is already open. This is the...
asked by 11.06.2017 / 01:37
1
answer

How to draw a picture with Canvas?

I have this code and want to draw an image: public void render(){ BufferStrategy bs = getBufferStrategy(); if(bs == null) { createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics(); g.dispo...
asked by 09.07.2017 / 04:15
1
answer

how to order JPanel in different positions?

Which Layout manager should I use to be able to position the panels as in the illustrative image below. Edit: I have the PanelX Class, which I set in JFrame as position SOUTH , inside this class I have 2 panels (Panel 02 and 03),...
asked by 27.06.2017 / 18:10
1
answer

how do I get a value from the textField and pass it to an int variable?

How do I get the value typed in a field of type JTextField and pass to a variable, so I can do calculations later? I tried to use getText() , but the variables because they are int , do not receive the content. I wanted to...
asked by 17.03.2017 / 06:50
1
answer

Add financial balance with Jtable

I'm trying to develop a Java sales control program, but I'm having a problem scheduling Jtable's balance. As you can see in the image below, the balance is being updated per line. However, since I declare the initial balance equal to 0, I nee...
asked by 20.05.2017 / 18:10
1
answer

How to validate if a String already exists in the JComboBox list? [duplicate]

package view; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import javax.swing.DefaultComboBoxModel; import...
asked by 18.01.2017 / 04:51
1
answer

Java Search Box

I'm creating a system in Java using NetBeans. I would like to create a search box that shows the results in a list (of variable size) under the box as the user enters the text to be searched. It would be something similar to the Google search bo...
asked by 27.12.2016 / 19:15
1
answer

Add functions to graphic application buttons

I'm having trouble putting functions for buttons in java. Can anyone help? Follow the code: import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Insets; import javax.swing.JButton; import javax.swing.JFra...
asked by 02.10.2016 / 22:14
2
answers

How to add items in a combobox dynamically in Java? [closed]

I have a project on netbeans that uses Java Swing for the interface. I have some data in MYSQL that would like to show them as soon as the window is created. Finally, how can I dynamically place items in a JComboBox in Java?     
asked by 01.12.2016 / 16:45