Questions tagged as 'swing'

1
answer

Add element in JList

This action of a button is to add the path of a file to a JList : private void bArquivoActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser fileChooser = new JFileChooser(); fi...
asked by 19.12.2017 / 00:32
1
answer

Display a string in a text field that is locked for editing

I developed a client-server chat and I'm adding some functions to make it more presentable and complete. One thing I still do not know how to do is display a string inside a text field. As soon as I run the program, I ask the user to enter hi...
asked by 16.09.2018 / 22:22
1
answer

DynamicReports Dynamic Graphics Generation

Hello, I made some reports with DynamicReports link , when looking for how to make graphics I found several examples, but none with the data (shown in the graph) being fetched from a Banco de Dados . In my reports according to the...
asked by 15.04.2016 / 13:25
1
answer

How to assign action to Image or Button

I'm developing the homepage of a simple game, what I want is to add a button on the screen where when I click on the game to start, follow below my code of how I'm setting up the menu and bringing the background, the code behind the image I put...
asked by 21.10.2015 / 13:14
1
answer

How to access member of another class? [closed]

I have a JPanel that contains all graphic elements, text fields buttons etc. This is a different class, which needs to know all the attributes of JPanel. The problem is that you are not accessing the member of class JPanel , already...
asked by 04.03.2017 / 02:54
1
answer

How to import a csv file into a JTable?

Does anyone know how to move from a csv file to a jtable? At the moment but list everything in the first column. private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { // TODO ad...
asked by 16.02.2017 / 18:32
1
answer

How to Mount a Jtable with ResultSet?

I have an example: Object rowData[][] = { { "Row1-Column1", "Row1-Column2", "Row1-Column3" },{ "Row2-Column1", "Row2-Column2", "Row2-Column3" } }; Object columnNames[] = { "Posição", "Nome", "Pontuação" }; JTable table = new JTable(rowData, co...
asked by 20.11.2014 / 18:05
2
answers

java.lang.nullException error

I'm developing software for an MVC (Model-view-controller) design video store with the Api Persistent Java Framework and the Extensible Markup Language (XML) language. My problem is this: When I log into the login screen of my system, a java....
asked by 09.06.2016 / 15:18
1
answer

Help with pointer error in Java

I'm doing a Priority Bank Queue project, I did everything the way I learned, but this is giving some null pointer error that I can not understand, could anyone please help me understand where I'm going wrong? Project link: Java Project...
asked by 27.05.2018 / 00:50
1
answer

I can not put image in a JButton [closed]

I tried to put the image but only gives NullPointerException , I already tried to create a folder called img inside the folder src and point there but without success too. I do not know what I might be doing wrong. The image...
asked by 30.10.2018 / 14:08