Questions tagged as 'swing'

1
answer

Adapt ToolTip code to a jTextField already created

I found this code that works well for the button: public class CustomJToolTipTest { private JFrame frame; public CustomJToolTipTest() { initComponents(); } public static void main(String[] args) { SwingUtilit...
asked by 13.11.2014 / 15:21
1
answer

Move from JFrame to JDialog

I've created a frame of this genre: Butsinceitwastoshowthattheclientwashavingtroubleconnectingtoaserver,itwasbettertoswitchtoJDialogProblem:IcannotgetJDialogvisibleCode:publicclassWaitingJoptionextendsJDialog{//seforJFramefuncionadireitopubli...
asked by 03.11.2014 / 16:16
1
answer

How to manipulate Labels using a loop

How can I use these labels using a loop, instead of creating 40 lines of code repeated? jLabel1.setIcon(new ImageIcon(getClass().getResource("/cards/"+cards.get(1)+".png"))); jLabel2.setIcon(new ImageIcon(getClass().getResource("/cards/"+cards...
asked by 12.09.2014 / 11:57
1
answer

Insert component without using the 'setBounds'

I'm using a free design in my project and dragging into my jframe the components I want. However, I needed to use a jComboBox with autocomplete and I was guided by this site. Now I wanted to use the class 'AutocompleteJComboBox' and apply it t...
asked by 18.11.2014 / 16:04
2
answers

Question about Listener for JComboBox

Would anyone know to tell me some Listener for when I select an item in JComboBox it gives me a warning for example. Remembering that when I open my component (JFrame) I hide items in there by the bank so I can not fall into the Listener. Let...
asked by 19.05.2014 / 20:56
1
answer

How to reduce the spacing between items in BoxLayout?

In my example, class Teste is JPanel with BorderLayout . Within the middle of this layout is a JScrollPane containing another JPanel with BoxLayout vertically. The intent is for items I add to this...
asked by 28.11.2018 / 18:27
1
answer

Merge RowFilter.andFilter with RowFilter.orFilter

I have a project that has a table and items to be filtered. They are a JComboBox category, a JTextField , and a JDateCooser date range. I made all the filters separately with RowFilter.andFilter and now I need to put them...
asked by 11.11.2018 / 14:30
1
answer

Fill table with data typed in the JTextField, separated by commas

I have the code below a JTextField , where I wanted to enter comma-separated numbers, and that by clicking JButton , the data would be added in a table column. public class Dados extends javax.swing.JPanel { public Dados() {...
asked by 11.05.2018 / 01:16
1
answer

Close system after closing Dialog

How can I make a login screen when closing, also close the entire system? In the code below I have a main screen with the "change user" button, when clicking, the system opens a Dialog for the new user to log in, however if the user cl...
asked by 13.05.2018 / 05:43
1
answer

Jtable with monetary value in a single column

Looking to implement monetary value formatting in a jtable, I've tried using the Rafael Chaves as a base and I was able to do the code below. import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.text.NumberForm...
asked by 13.06.2018 / 04:58