Questions tagged as 'swing'

1
answer

How to prevent a certain key being sent to the program several times

I'm making a calculator for year-end activity, which even works normally, as long as it does not exceed typing. For example, if you make the sum of two fractional numbers, it sums all the sum correctly, but if you accidentally enter more than on...
asked by 23.11.2016 / 16:43
1
answer

Decorating a JTextField with an icon

My question is whether it is possible to "decorate" a field, such as JTextField or JFormattedTextField, with an icon. An example would look something like this: Following an example, I made the following class. package componentes;...
asked by 09.12.2016 / 23:36
1
answer

How to limit and display the number of characters in a JTextArea

I have a supplier registration window, and I would like to enter a jTextArea so that the user has the option to enter any comments about the supplier. The idea is to limit the number of characters to be typed and show the amount...
asked by 14.07.2016 / 20:15
2
answers

List years in JCombobox dynamically from given rule

I have an application that lists records in a JTable , and each record has a record date using Date . In this list, I put a filter per year via JCombobox , where the initial year is what the application started to use (2013)...
asked by 16.12.2015 / 12:01
1
answer

Change button color at runtime

I asked for help on how to paint a button with 3 different colors: can put 3 colors on a button? But I'm trying to change its color at runtime and I can not. Same instantiating a new one and replacing it. The button class is this: cla...
asked by 08.10.2017 / 20:31
1
answer

How to leave more than one transparent panel?

Implementing the response response, I was able to leave a transparent panel. However, to be able to organize the way I want, I wanted to use more JPanels , with different layout managers. But when I do this, they do not become transpa...
asked by 01.04.2018 / 19:59
1
answer

mysql remote database slow with java swing application

I have a java swing application that is connected to a remote Mysql database, ie on an online server. When I run the program it works fine, except for the slowness of the bank's response. For example, I open the user registration window and i...
asked by 17.09.2015 / 01:59
1
answer

How to create a circle of progress?

I want to make a circle progress like this: In Java, I could only find something about JProgressBar .     
asked by 31.08.2015 / 20:04
1
answer

Why does the size of the JFrame exceed the size of its ContentPane, even if it has a defined size?

I noticed a strange behavior between containers in the swing. To exemplify the test, I created a JFrame and a JPanel , and set the panel to contentPane of JFrame . Set the preferred and maximum size of the JPanel t...
asked by 10.05.2017 / 20:00
1
answer

Flashing buttons with Thread

I have a problem trying to make the buttons blink. Using Thread.sleep() , when clicking the button, Thread.sleep() ignores what comes before it, executes sleep and executes only what comes next, in this case setBackgrou...
asked by 28.03.2017 / 20:31