Questions tagged as 'swing'

1
answer

Show textfield or textarea java [closed]

I can not display words in textfield (or textarea) in my code, several hours on it and still can not. I have here a link to the code . The most important lines are these, but if you want to test the whole code, it's easier to help, I guess....
asked by 10.06.2015 / 21:36
1
answer

Changing size of JOptionPane.showInputMessage

I tried several methods like setPrefferedSize, setSize with / without pack () but nothing seems to affect JoptionPane code: selectProcess = new JOptionPane(); selectProcess.showInputDialog(null,"Please select game process","Sele...
asked by 30.08.2014 / 16:34
0
answers

Add checkbox to a JTree

I have already looked at quite a few examples out there of JTree s with checkboxes but it seems all very complex to me. Does anyone know a simple way, if any, to add a JTree that I dragged into my frame, a checkbox on each of th...
asked by 02.12.2014 / 13:20
2
answers

JOptionPane, example?

Well, JOptionPane needs all these add-ons: JOptionPane.showOptionDialog(parentComponent, message, title, optionType, messageType, icon, options, initialValue); Could you give an example of all of these complements filled out...
asked by 18.08.2014 / 19:24
1
answer

How to change the border color?

How can I change the border color created by BorderFactory? import java.awt.Dimension; import java.awt.GridBagLayout; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JPanel; publ...
asked by 17.06.2017 / 02:39
2
answers

How to make buttons of various formats in java?

I'm creating a little game using Swing, and I would like to make buttons with different formats, the way I choose. For example: a round button, or an eye-shaped button, for example. And if they did, I'd also like to know how to put textures o...
asked by 11.05.2014 / 02:24
1
answer

Temporary text in JLabel

I would like to change the text of a JLabel and leave it for just a few seconds, then return the previous text. I have to run a method that takes a few seconds to get ready and would like to notify the user that it is running and this way...
asked by 07.12.2015 / 23:49
2
answers

How to expand the window when you click a button?

Is it possible to expand a window with more information when the user clicks a "Details" button? The behavior is similar to some error screens, which show the data of an error, as shown in the image below: My window has a JButton...
asked by 03.03.2015 / 19:26
1
answer

Change text and background color ToolTip

How can I change the background color and text of a ToolTip? I already did a search and found here a code snippet but I can not change it. The colors always remain the standard NetBeans. Any suggestions? I put the following code in the cons...
asked by 14.11.2014 / 10:48
1
answer

How to set contents in position 0 with field disabled?

I need, when my component receives a text (it will receive through a query), the text is "set" at the beginning of the field, because in many cases the text is long and the beginning is omitted. The detail that is complicating the solution is th...
asked by 25.08.2017 / 18:07