Most voted "jtable" questions
Jtable is a Java Swing component used to display and edit regular two-dimensional cell tables.
Learn more…126 questions
Sort by count of
-
1
votes1
answer628
viewsAdd line with empty fields in a Jtable
I have a AbstractTableModel only that I do not know how to add blank lines, when pressing the add line button on my frame I want it to call a method called addLine() of my Modelotabela, someone can…
-
1
votes1
answer156
viewsQuery ORDER BY dynamics from the selection of a combobox
I’m developing an application on java managing a database. This application primarily performs a SELECT the database, then submitting the ResultSet for an editable table. I tried to add a comboBox…
-
1
votes1
answer65
viewsJtables Simultaneos
Hi, I was wondering if there’s a way to select 2 Jtables simultaneously, I’ll explain: i need some columns of my Jtable, do not change when the horizontal Jscrollbar is changed, according to my…
-
1
votes3
answers1071
viewshow to select the entire row of a Jtable using Defaultcellrenderer which changes the color of the line
Hello, I’m working with Jtables and on such a Jtable I needed to leave some lines in differentiated colors, so I implemented the method class cellRenderModel extends DefaultTableCellRenderer { /** *…
-
1
votes1
answer144
viewsPlace a table created in an existing container
need help! I’m developing an application in college that will use Bubblesort - yes! We had the misfortune to catch this one! - to draw some data within a table. I created the table through a class…
-
1
votes1
answer196
viewsHow do I get a line back on my jTable?
I’d like to know how to retrieve information from a line of mine JTable, follows the code line of the same. Usuarios operacao = new Usuarios(); DefaultTableModel tabela = new DefaultTableModel();…
-
1
votes0
answers131
viewsclass fill table made in DAO class
Guys, I’m a little tied up and I’d appreciate your help. The project works, inserts users into the database, but I would like to do a jtable to display the entered data; Here the complete…
-
1
votes1
answer365
viewsRender table cell image size
I created a java table that shows my images stored in blob in the database. However the height of the table is not automatically resized having to put a value manually, for example:…
-
1
votes1
answer319
viewsMultiply 2 fields in Jtable
I’m trying to get a 2-field multiplication on Jtable but I can’t do it Specifically the Quantity Field and Unit Value to multiply and give the Total Value Tela do Jtable package Telas; import…
-
1
votes1
answer1239
viewsHow to change the color of a Jtable’s lines?
I need the line color to change whenever the cell value is 0. However, all lines are being painted. View with a simple Jtable import javax.swing.JTable; public class View extends javax.swing.JFrame…
-
1
votes1
answer415
viewsHow to hide and block the last line of a Jtable?
It is possible to hide and lock the last line of a DefaulTableModel? I have this difficulty and I am not able to solve it. If it is not at least possible to hide this line? import…
-
1
votes1
answer443
viewsEnter edit mode when typing something when Jtable’s cell is focused
I have a celleditor in the format of textarea, and when you’re focused, I squeeze some word to type in celula. It opens the edit mode, but does not write anything, which may be wrong? working class…
-
1
votes1
answer224
viewsView Jtable on multiple panels
How do I make mine JTable is displayed on all tabs inside the panels? I’m only able to display in the "Day 5 tab". import java.awt.Container; import java.sql.ResultSet; import…
-
0
votes0
answers399
viewsHow to save the selected line of a Jtable in the BD?
I have a JTable which fills the database, where I can select several lines at the same time with the Boolean field that has been added. I need that when you click the "record" button on mine form…
-
0
votes1
answer1665
viewsPrint Arraylist, Java Swing
I am starting my studies in Java applications with Swing, and I have doubts about how to print my Arraylist. How best to print or list an Arraylist within a window? In my case we have an agenda, we…
-
0
votes1
answer221
viewsScrollbar in a Jtable
I added a JTable that updates the data as the customer type in a field JTextField. However, when the client search returns multiple lines, I would like the JTable had a scroll so that the customer…
-
0
votes1
answer142
viewsHow to use a selection setBackground in custom Renderer?
I’m trying to use a render Cell, so when it shows monetary data, it does the formatting. However, when I apply the render in a particular column, the focus in that column does not have the…
-
0
votes0
answers35
viewsJava jtable, parameter error?
I’m having a hard time getting through parameters for my jTable, these parameters being a Object[][] and a String[]. tabela = new JTable(dados, colunas); It does not work the data is a matrix like…
-
0
votes1
answer422
viewsColorize jTable lines ready
I have a code and I need to make some improvements, but I’m not able to insert them properly, I’m a beginner and I have some difficulties. The software has: a Beansclient class with the get and set;…
-
0
votes0
answers41
viewsI used the code of the link below, and this code below. But it does not save the title of the lines of Jtable, how to save the titles of the lines?
https://stackoverflow.com/questions/8187639/jtable-with-titled-rows-and-columns MessageFormat header = new MessageFormat("Report Print"); MessageFormat footer = new…
-
0
votes1
answer2198
views -
0
votes1
answer406
viewsplace name in columns from an object array
public class TableModelAgendamento extends AbstractTableModel { int contador = 1; int qtdFuncionario; private TOFuncionario[] func = new TOFuncionario[qtdFuncionario]; String coluna[] = new…
-
0
votes1
answer614
viewsMark/Deselect a line in Jtable, changing its color
Good morning, everyone! I’m new to the forum, and I apologize if I opened this topic in the wrong place. Well I have a huge problem with an action that I’m trying to do in Java Swing with the Jtable…
-
0
votes1
answer140
viewsError to popular jtable with database
I have to make a client registration application in JAVA, I am using eclipse. The problem is in the method listarCli(), because when I comment on this method the error does not appear. The error is:…
-
0
votes1
answer252
viewsError while trying to place Jcheckbox in a Jtable column
I’m trying to add a column to a DefaultTableModel, but seems to be giving some problems. Follows code! JCheckBox jcheck; DefaultTableModel modelo = new DefaultTableModel(null, new String[]{"Data",…
-
0
votes1
answer45
viewsArrayindexoutofboundsexception when trying to fill a Jtable from a query
I am performing a query in the database to pass the information to a JTable. However, when performing a query, the following error appears: Exception in thread "AWT-EventQueue-0"…
-
0
votes1
answer277
viewsProblems with paging on Jtable
I am creating an application where I fill the data of a table through the database, but there are many so I wanted to organize better. However, the results shown in the table are not constant. The…
-
0
votes1
answer74
views -
0
votes1
answer44
viewsHow to load database data to a jtable
At the time of execution appears the error message of this excerpt and I am not able to find the error. I know the connection to the bank is right because I have other classes in the same program…
-
0
votes0
answers63
viewsHow popular is Jtable?
I have to fill out a table with bank data. But nothing appears at all. My Class Inserting information in the table: DefaultTableModel dtm = new DefaultTableModel(); String sql = "select * from…
-
0
votes2
answers52
viewsSelect from empty data
My code returns all users, checking if they paid the last month, however I connect two tables, one of all customers with the registered payments table, I want to print on jTable even if you have no…
-
0
votes0
answers209
viewsTaking textarea data from a Jtable
I know how to use the DefaultTableModel is not the best way to make the tables, however I have not mastered anything of AbstractTableModel, i have a table that is edited as Jtextarea, but when I…
-
0
votes0
answers587
viewsConstructing a java table from a vector as parameter
Hello! I’m having trouble constructing a table. Here’s the thing, the user defines a series of variables that are stored in an array. I would like the variables stored in this vector to constitute…
-
0
votes2
answers1217
viewsUpdate Jtable using Defaulttablemodel
I understand that the use of Defaulttablemodel is almost abhorrent, however, I used this model and now I have no time to change to a Tablemodel (which I haven’t learned to use yet), is there any way…
-
0
votes2
answers172
viewsSum mm:ss of a jtable column
Good afternoon, I know that the way I’m going to explain it is difficult to help me. I have a jTable that contains a column where times are shown, those times in mm:ss. I need to average between…
-
0
votes1
answer731
viewsLeave only one editable Jtable column
I have my data model that I made for tests as shown in the code below: public class ModeloDados { private String nome; private String sobreNome; private String telefone; public ModeloDados(String…
-
0
votes0
answers310
viewsIdentify empty columns of a jTable and paint the entire row red
I am importing a file in Excel and playing inside a jTable, so far so good. What happens is that there is user inserting spreadsheet with empty fields. I would like to leave the whole Lina in red…
-
0
votes0
answers53
viewsIncrement equal amount of service
I have a table with the service code, service, quantity, value and total. When I add an ITEM 1 in the table for example, the data of this service will be added in the table. But in case I add this…
-
0
votes1
answer1097
viewsSet selected Combobox item as clicked on jTable
I am trying to fill in the form fields as per the item clicked on jTable. Text fields are normally filled in, but the combobox remains at the selected default value. //método que preenche a comboBox…
-
0
votes1
answer76
viewsIndexoutofbounds when filling an Abstracttablemodel
I have a AbstractTableModel who owns a List filled by a method that searches the data in the database. The method that fills the List has two overloads: one without any parameter (that searches all…
-
0
votes1
answer573
viewsAdding Financial Balance with Jtable
I’m trying to develop a sales control program in Java, but I have a problem when it comes to scheduling Jtable’s balance. As you can see in the image below, the balance is being updated per line.…
-
0
votes3
answers422
viewsAllow only integers in a Jtable column
Below I have a model of Jtable. There is only one editable column for number (seconds). How to validate to accept only integers, and in case the user enters anything else except integer, return…
-
0
votes1
answer563
viewsJtable currency format
I am making a Cellrender with currency format. I placed 13 columns in a jtable, one has the recipes (Salary, 13th salary, Overtime).. and other 12 with the months. each month the person will enter…
-
0
votes1
answer431
viewsCheck if you have reached the last row of the table
I’m using this code to do a approved or flunked, but when he gets to the last line, he’s not checking if he’s on the last line and he doesn’t give me the result. I would like to know how to check if…
-
0
votes0
answers101
viewsHow to filter Column in Jtable with Calendar type data
I’m trying to filter dates using the Tablerowfilter, but it is not working properly even selecting in the filter the exact column and for example typing 24/11/2017 the filter after typing the first…
-
0
votes1
answer365
viewsPopular combobox inside 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 =…
-
0
votes1
answer99
viewsError while trying to implement Jtextarea in Jtable
I’m trying to use this JTextArea in some columns of mine JTable, but something’s going wrong. I know it’s wrong, but I’m using DefaultTableModel. public class TextAreaCellRenderer extends JTextArea…
-
0
votes1
answer216
views -
0
votes1
answer76
viewsProblem when reloading Table
I have the following problem, at first run my Defaulttablemodel loads normally as can be seen below in red: After registering, changing or deleting once, the table updates normally, but when I…
-
0
votes1
answer862
viewsHow to insert column titles into a jTable?
I couldn’t display the title of the chart, could you help? Obs.: I inserted it "JScrollPane scroll = new JScrollPane(tabela);" and "contentPane.add(scroll);" or "getContentPane.add(scroll)" as I saw…