Questions tagged as 'java-swing'

1
answer

problem with Jframe netbeans POO events

I am working with events in Java Swing and it happens that in a JFrame I have uploads of three images. What I need is to know how I do so that when I press an image when I run the program it moves vertically and I can stop it with another click...
asked by 10.04.2017 / 20:56
1
answer

Java Error after pressing button to add fields in a JPanel

Thanks for informing me. I have transcribed the question in case there were more people with the same problem. TITLE: Java error after pressing button to add more fields to a form. Can you help me with the following error, please? Would any...
asked by 24.12.2016 / 18:18
1
answer

Problem with updating method in Database

I have this method save in a class that controls frame events: if(e.getSource()== estMostrar.getBtnModificar()){ String nombre= estMostrar.getTxtNombre().getText(); String materia= estMostrar.getTxtMatricula().getText();...
asked by 09.09.2016 / 03:16
3
answers

How to make all the complete information come out in a JTable

I would like to know how to do all the complete information in a JTable that I created in a JScrollPane. I created the header with the DefaultTableModel code. Thanks. DefaultTableModel mMedico=new DefaultTableModel(); mMedico.addColumn("...
asked by 19.07.2016 / 20:20
1
answer

F1 JavaHelp key

In any program or application, most of the times when pressing the F1 key, a help system is opened referring to that utility. I am in my project and I have created a help system, which should be opened by pressing F1 but not ... 1) Fail to pr...
asked by 08.01.2017 / 22:11
1
answer

Simplify method using lambda expressions

I have this simple method: public void setComboBoxItems(List<User> users, List<Client> clients) { for (User user : users) { usersIds.addItem(user.getId()); } for (Client client : clients) { clientsIds.a...
asked by 15.12.2018 / 17:49
1
answer

Show icons in order in Java Swing

I'm doing a program that shows two buttons with two different colors (in this case Red and Blue) and according to the user presses one or the other it is shown in a label panel that is higher, so that if the user presses the Blue button and then...
asked by 24.09.2018 / 03:40
2
answers

Save to an ArrayList, the previous items are repeated

I have the following code to fill in a table, however when entering a second time information and save it, when the method updates the list, the data is duplicated, for example: If I enter Juan and save it shows Juan only, but at enter another n...
asked by 11.06.2016 / 04:15
1
answer

How to add a placeholder in a JPasswordField

As the title of my question indicates, I am trying to add a placeholder in a JPasswordField, however it could be said that I have achieved it halfway. What I have done so far is to use the following code (which I adapted from an answer I foun...
asked by 16.07.2018 / 21:03
1
answer

Show elements of ArrayList in another window

I'm doing a small application that makes a draw among several participants and shows the result in a JDialog. I have two errors in the code that do not allow it to execute well: private void jButton2MouseClicked(java.awt.event.MouseEvent e...
asked by 08.01.2018 / 19:11