Questions tagged as 'swing'

1
answer

How to get the value of a JSpinner, inside a loop?

I am putting together a screen where products from a database are displayed: product title, price, button, and a spinner. I try to give a getValue of jspinner, however it does not return the value that the user indicates. public class Minimo e...
asked by 31.08.2018 / 17:33
1
answer

How to align JButton text to the left of the icon?

I need to align the text of JButton to the left of the icon as I do? I tried using the button.setHorizontalAlignment(SwingConstants.LEFT); But this method does not align the text the way I want it. It's getting the same as the...
asked by 21.02.2018 / 19:33
1
answer

Popular combobox within the jtable with database, how to proceed?

Currently I populate a normal combobox this way: this.CadperfilLinha.removeAllItems(); try { Class.forName(Auxiliar.AcessoBanco.getDriver()); Connection con = DriverManager.getConnection(Auxiliar.AcessoBanco.getUrl(), Auxiliar.AcessoBa...
asked by 08.01.2018 / 13:38
1
answer

Jtable currency format

I'm making a coin-shaped CellRender. I put 13 columns in a jtable, one has the recipes (Salary, 13th salary, Extra hour) .. and outas 12 with the months. every month the person will type this information and then I will add another jtable with t...
asked by 13.09.2017 / 16:59
1
answer

Creating field with weight format with two decimal places and 3 houses before the comma

I'm trying to create a "weight" field, but I'm having some problems. Weight can range from 2 to 3 decimal places before the point. For example, it could be 80.00 kg or 100.00 kg. However, in the way I'm doing, it forces me to put the 3 houses...
asked by 31.07.2017 / 01:19
1
answer

Position JCombobox on the screen

I made a combo box, in netbeans per command, and I can not change it's location (in the frame), the Bounts values change, but it does not move. I've used all kinds of commands (setBounds, setPoint, setLocation, etc.). public JComboBox<Strin...
asked by 21.07.2017 / 04:28
1
answer

How to break line automatically in a text component?

I would like you to break automatically when you reach the maximum number of letters / words on that line. When I put a pizza it works quietly: ButwhenIputmorethanonepizzathetextgetsbiggerthanthejLabelthereisnottoseeallthepizzasnorthetota...
asked by 15.07.2017 / 01:04
2
answers

Equivalent to C # Form.ShowDialog () in Java

I'm starting now in Java, there's a feature I use a lot in C # which is NomeDaTela.ShowDialog(); . I wanted to know a similar code that does the same thing in Java.     
asked by 16.01.2017 / 16:28
1
answer

How to use a selection setback in custom renderer?

I'm trying to use a cell render, so when I display monetary data, it does formatting. However, when I apply rendering to a particular column, the focus in that column does not have the background of the rest of the row. To solve this, I thoug...
asked by 05.11.2016 / 15:36
1
answer

How to validate jcomboBox before saving

I have the following problem, I am trying to validate these jcombobox, I want that if the user does not select a jcombobox item from the movie, a message appears: "Select Movie", if already the client, a message appears: Select the Client "and i...
asked by 26.11.2016 / 13:03