Questions tagged as 'swing'

1
answer

Use the same jFormattedTextField for CPF and CNPJ mask

I would like to know if it is possible in a same JFormattedTextField , toggle mask for CPF and CNPJ. When I use the mask of JFormattedTextField the value is already static, and if you put it to the CPF, it will not fit the CNPJ a...
asked by 15.07.2016 / 15:26
1
answer

Minimize + SytemTray

People are wanting to click to minimize the program, the icon is next to the clock. I created a button that does this action. I confess that I did not do it, but the author helped me a lot. This is code I am using on the button. I wish I coul...
asked by 30.03.2015 / 03:06
2
answers

Center Swing Window

I wanted to know how to do when to call a secondary window in Swing it left centered with the main window of the program. At the moment, when I call it it appears in the upper left corner.     
asked by 23.09.2015 / 13:46
2
answers

JPanel width exceeding the dimension defined in getPreferredSize ()

I'm trying to create a breakout game, I've already done a lot of logic, but I've discovered an annoying problem regarding the size of the "scene" panel of the game. Here is my class Board , which is the panel where all the components of...
asked by 11.05.2017 / 16:33
1
answer

Lambda expressions in nested classes with multiple methods

I was reading about lambdas and out of curiosity, I wanted to know why it is not allowed to use when the class / interface has more than one method, which forces us to do things like below: component.addMouseListener(new MouseListener() {...
asked by 12.07.2017 / 15:13
1
answer

How to align the column title of a JTable?

I have an (abstract table model) table and would like to center the column headings. I've tried the following: DefaultTableCellRenderer centralizado = new DefaultTableCellRenderer(); centralizado.setHorizontalAlignment(SwingConstant...
asked by 30.10.2016 / 22:40
1
answer

How to remove hover from menu items and buttons?

I think my question is quite objective: how to remove the hover effect from menu items and buttons? Here is an image of the hover effect that I want to remove (button and menu items):     
asked by 06.11.2017 / 20:23
1
answer

Dynamic Graphical Interface in Java

I need to create something like this: I usually do the GUI with the help of the IDE but in this case I can not (I think) because I need the GUI to repeat a number of undefined times, depending on the user in question. What is the best...
asked by 06.08.2014 / 18:32
2
answers

How to pass an array to a JTexfield?

I'm doing a college job where we have to do a kind of login screen, however, with array and not Arraylist . My question is how do I pass information from JTexfield to array ? This array needs to have the funct...
asked by 28.10.2014 / 15:32
1
answer

Change JTextField value from another class or automatically

I found some similar issues in the English version, but I could not resolve it. I have a Boiler class, with the following attributes: Boiler temperature; Water quantum; Fire temperature; In this program I will have to keep the boil...
asked by 14.08.2018 / 18:26