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
-
11
votes1
answer4373
viewsHow to popular a Jtable with own Tablemodel?
When you’re messing with swing, we almost always come across having to handle tables and populate them with some kind of information. For simpler situations, the DefaultTableModel resolves, but when…
-
9
votes1
answer510
viewsHow to make Jtable values the same as Arraylist<Pessoa>?
I have an example program that adds objects of my class type Pessoa in a JTable and also in a ArrayList<T>, this program has three basic functionalities which are as follows:: Add Alter Erase…
-
8
votes1
answer1056
viewsTransfer focus from a Jtable cell right after typing time
Hello, I’m using a JTable for typing time card. I need help with this, but I’ve already done a search and nothing helped me very much. I’ve tried to do it in many ways and I couldn’t. I have several…
-
6
votes1
answer7351
viewsHow do I popular a Jtable?
I have a very simple java application, which connects to a database, in the console I type the query I want that is passed by parameter to the Query. Now I need to move all this to a graphical…
-
5
votes1
answer851
viewsJtable getValueAt() behaving differently than expected
I have a Jframe where there’s a Jtable that displays some data. When the user selects some records and clicks on a certain button, those selected records should be deleted. When only one record is…
-
4
votes2
answers1204
viewsFixed column of a Jtable in a Jscrollpane
How do I leave a fixed Jtable column (no scroll) inside a Jscrollpane? I want to leave the first column of a fixed table, the scroll bar will only scroll from the second column onwards, the first…
-
4
votes1
answer3825
viewsHow to color specific lines of a Jtable?
I’m developing a Java application that involves a JTable, i need to paint some red lines depending on the age and status of that line. I’m wearing a DefaultTableModel to popular my table. I don’t…
-
4
votes1
answer588
viewsJtable, add multi-lines[Cell span] +Format table
I need to do something like this: Right now I have a table like image 1, but I wanted to create a table like image 2. How can I create something like this? Any ideas? The closest example I saw was:…
-
4
votes1
answer2475
viewsHow to popular a Jtable using a . txt file?
I wonder how do I make to popular one JTable using a pre-existing text file. I have a query table and I want the user when placing the account number, it shows the data on Jtable and also how I can…
-
4
votes1
answer292
viewsJtable does not save information when focusing on the cell
My JTable does not save information when there is focus on the cell. To effectively save the information I need to focus manually and then click on the "Register". How can I make this process…
-
4
votes1
answer2506
viewsInsert data into a table from a Java form (Netbeans+SQL Server)
I have a form created so that I can enter data about a client and from this form open a table with a button that has the data, so far I have been able to link the buttons. Now my question is how I…
-
4
votes2
answers661
viewsReturn jtable line information after selection
I have an application with 2 Jframes.. 1st Jframe: A screen with a search button and Jtextfield 2nd Jframe: A Jtable with BD information. When I click the search button in the 1st Frame opens the…
-
4
votes1
answer1310
viewsHow to align the column title of a Jtable?
I have a table (Abstract table model) and would like to center column titles. I tried the following: DefaultTableCellRenderer centralizado = new DefaultTableCellRenderer();…
-
4
votes2
answers1662
viewsApply filters to a Jtable
I have a table and in a JPANEL on top of it I created textFields and combobox with the intention of using them as filter. The method: tableRowSorter.setRowFilter(RowFilter.regexFilter("(?i)" +…
-
4
votes1
answer1484
viewsUpdate a Jtable that is in a Jframe from a Jdialog
What I’m doing is a little longer, so I’m going to shorten the problem with a more objective example: I have a registration form and created a modal Jdialog with the fields I want to search. When I…
-
4
votes1
answer305
viewsRowfilter.regexFilter does not filter Date type columns in Jtable
I have a JTable with a TableModel customized, and I’m trying to run a search field using JTextField. However, columns of the type Date and my class Cadastrante are not researched. In my TableModel,…
-
3
votes1
answer677
viewsHow to set background color on multiple lines of a Jtable?
I would like to know how to set the background color of multiple rows of the table. In the code below it simply arrow the background in only one line, that is, in the last element of the vector. The…
-
3
votes0
answers109
viewsClassifying with colored cells and Date column
I have two problems to finalize my table: 1) I have one TableCellRenderer customized to paint an entire row based on the value of a column. It works, but when I click to sort, the colors of the…
-
3
votes1
answer1699
viewsUpdate a Jtable within a Jframe through another Jframe
I own a JFrame, where inside it has a JTable and a JButton (Change) that makes the call from another Jframe. In this other Jframe, a data change is made according to the row selected in the table…
-
3
votes2
answers2074
viewsAdd line in Jtable at the click of the button
I’m starting in creating interface in Java, an example I’m trying to do is to have a form with textField nome and email, and by clicking on the Enviar the data of those textField goes to my JTable,…
-
3
votes1
answer1765
viewsHow to change the text color of a column of a Jtable
I have a form for payment of installments, and this form has a table where I show both the installments paid and those that should still be paid. To popular this JTable, I make a query in the…
-
3
votes1
answer571
viewsHow to change the Jtable header background without removing the edge?
I’m trying to change the color of the background header of JTable. With this code I got: public Principal() throws UnsupportedLookAndFeelException { initComponents();…
-
2
votes2
answers505
viewsPassing Different Object Types to a Tablemodel
I’m starting to mess with Jtable but I’m having a doubt. I’m seeing this post here on another forum and my question is. In case it passes to the table template a list of book type: private…
-
2
votes1
answer1507
viewsSelect Multiple Lines in Jtable in Java
Good evening Guys, my doubt is how to select several lines in an action, is that I intend to create a condition in a column if the value is higher select the row, more if have equal values have to…
-
2
votes1
answer3515
viewsHow to take data from a Jtable for storage in a database?
I’m developing a project called Menu List with a Mysql and Java database in Netbeans, with an added Mysql-Connector-Java library. I want the names of the selected products, the quantity of products…
-
2
votes1
answer1973
viewsAdjust columns according to available Jtable size
I have a JTable where the user can hide and then re-display one or more columns. I found a code at this link which adjusts the column according to the size of the "field value". I call this method…
-
2
votes1
answer503
viewsRemove selection color from Jtable’s line?
It may sound silly, but I can’t find the method to remove the color from the selection when the mouse clicks on the line. I have a table with red and blue lines, blue colors are lines that mean an…
-
2
votes1
answer292
viewsCollect data from a Jtable and send to a List
In my Java application, I have a sales screen where the products that are selected go to a JTable. At the end of the sale, I need to collect data from JTable and deliver to the printing method,…
-
2
votes1
answer243
viewsHow do I define column size?
I have a query screen, and I would like to define the size of the columns, because some columns take up more space than necessary. I thought that if I made a comparison with the title of the column,…
-
2
votes1
answer290
viewsHelp to fill jTable
I’m filling out a jtable with the birthday kids who are registered in a database. public void jTablePop() { javax.swing.table.DefaultTableModel dtm2 =…
-
2
votes2
answers80
viewsButton does not work when code is added to Abstracttablemodel
I created a test project to implement in a larger table project with a button as one of the row elements. It works perfectly, but when I try to add to my code the button does not perform the action…
-
2
votes1
answer150
viewsHow to create Tablecellrenderer for strings?
I wanted to know how to make a Tablecellrenderer for strings. on this topic here: How to use a selection setBackground in custom Renderer? I saw that the guy had to "values". I wanted to know if to…
-
2
votes1
answer1100
viewsPick up Jtable’s line after Filtering Data
I’m wearing a TableModel(not the DefaultTableModel) which I populate with data from banco (MySQL), I also use a Class to filter through what I type into a JTextField. It is working correctly, but I…
-
2
votes0
answers81
viewsLoading Jtable and processor gets high in process
I’m making a sisteminha and in it has a JTable and I need to loader my data, I’ve been analyzing by task manager that when this table load function is called, it greatly increases the processor…
-
2
votes1
answer155
viewsData is not displayed in the table by Abstracttablemodel
I am developing a ticket request system, but for having to add a JXDataPicker in the table, I had to implement the AbstractTableModel. The model apparently agrees with the documentation, I can…
-
2
votes2
answers1331
viewsHow to change the vertical grid line size of a Jtable?
How do I change the size of the vertical grid lines of a Jtable? Ex: jTable.setRowHeight(30); This method above changes the line width. Have some other similar to this which changes the vertical…
-
2
votes1
answer51
viewsTable Not Loading
I’m trying to make the table list load and not loading always gives this error Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem: The constructor…
-
1
votes1
answer625
viewsHow do I send data from a Jtable to my BD?
I have a filled-in Jtable and need to store its data in a table in my database. How do I do that? I only know the reverse way (fill a table from the BD) am using Mysql
-
1
votes1
answer343
viewsHow to clear Jtable’s cell when starting typing?
How can I clear the cell in Jtable by starting to type in an equal cell in excel. For example, I place the cursor in a cell and when starting to type the cell enters editing mode, at this precise…
-
1
votes1
answer1996
viewsHow to update a jTable that displays BD data after registering a new item?
I have a table (jTable) that displays all the data registered in a database. My table is filled every time the application is started through a Windowevent, but when I make a new registration in the…
-
1
votes1
answer801
viewsJtable does not display column names
I made a Jdialog that will show some statistics of the users who use the software, but I’m not able to make the columns name appear. I tried to add using the .addColumn model but not working. class…
-
1
votes2
answers900
viewsEnable Jbutton from selection in Jtable and remove the initial focus from the table
I have a window with a JTable, where only an entire row is valid, not just one field. The point is that the window already opens with the first line selected, and I’d like to disable that. In that…
-
1
votes1
answer538
viewsHow to create a dynamic Jtable?
I have a JTable in my form, I wanted the size(number of rows and columns) of the table to be according to the number the user enters, how to do in java?
-
1
votes1
answer1738
viewsSearch using Jtextfield and Jtable
I have a question as to the research on a Jtable using Jtextfield. When the person enters the Work name in Textfield and click Search, in Jtable is to appear the search result. My question is this:…
-
1
votes1
answer355
viewsAdd lines in a Jtable according to ascending order
I’m making a RBC system to verify the similarity between computers. I would like to sort my table rows by the value of probability. The problem is that the table has around 9,500,000 rows. Does…
-
1
votes1
answer961
viewsHow to update Jtable used data from a database?
I created in Netbeans a customer registration and movie registration system (simulating a video rental company). I have 3 Java files: Video Rental (main), Client and Movie. In Client and Film, I…
-
1
votes1
answer71
viewsDisplay multiple columns
I am developing a basic program in Java Application (Desktop) that performs a simple registration and displays on another screen through a Jtable the recorded data in the same. My problem is that…
-
1
votes1
answer294
viewsHow to apply a Jdatechooser two filter to a Jtable?
I need to filter the data simultaneously to be displayed in a JTable. Consulting some old questions I managed to solve part of my problem. I have a DATE field in the String type table and I have two…
-
1
votes1
answer97
viewsCombine Rowfilter.andFilter with Rowfilter.orFilter
I have a project that has a table and items to be filtered. They are a categoryJComboBox, an id JTextField and a date interval JDateCooser. I made all filters separately with RowFilter.andFilter and…
-
1
votes1
answer3495
viewsUpdate Jtable after each data change in a cell
I’m using java swing where I have a window and in it a JTable. I run a method where you will read the data from this Jtable and update a column, cell by cell, of this Jtable. The problem is that it…