Questions tagged as 'jtable'

1
answer

JTable does not save information when there is focus on cell [closed]

My JTable does not save the information when there is focus on the cell. In order to effectively save the information I need to manually focus and then click the "Register" button. How can I make this process automatic, every time I...
asked by 22.09.2014 / 21:06
1
answer

Jtable, add multi-lines [cell span] + Format table

I need to do something like this: AtthispointIhaveatablelikeImage1,butIwantedtocreateatablelikeImage2.HowcanIcreatesomethinglikethis?Anyideas?ThemostsimilarexampleIsawwas: link [EDIT] To create the multi-lines I used this class "Attr...
asked by 30.07.2014 / 10:38
2
answers

Apply filters in a JTable

I have a table and in a Jpanel on it I created a textFields and combobox with the intention of using them as a filter. The method: tableRowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + busca)); Does he expect a string as a filter? If t...
asked by 21.11.2016 / 23:18
1
answer

How to align the column title of a JTable?

I have an (abstract table model) table and would like to center the column headings. I've tried the following: DefaultTableCellRenderer centralizado = new DefaultTableCellRenderer(); centralizado.setHorizontalAlignment(SwingConstant...
asked by 30.10.2016 / 22:40
1
answer

How to change the background of the JTable header without removing the border?

I'm trying to change the background color of header of JTable . With this code I was able to: public Principal() throws UnsupportedLookAndFeelException { initComponents(); jTable.getTableHeader().setDefaultRend...
asked by 04.11.2016 / 16:16
1
answer

Update a Jtable that is in a JFrame from a JDialog

What I'm doing is a little longer, so I'll shorten the problem with a more objective example: I have a registration form and created a modal Jdialog with the fields that I want to search. When I search in JDialog I would like to filter the in...
asked by 02.02.2016 / 12:28
1
answer

Update a Jtable within a Jframe through another Jframe

I have a JFrame , where inside it has a JTable and a JButton (Change) that calls another JFrame. In this other JFrame, a change of data is performed according to the row selected in the table and saved in the DB when clicking...
asked by 24.07.2017 / 17:21
1
answer

How to set the background color in multiple lines of a JTable?

I would like to know how to set the color of the background of multiple rows in the table. In the code below it simply directs the background in just one line, that is, in the last element of the vector. The idea is to pass a list of strings, an...
asked by 18.02.2015 / 17:09
1
answer

Formatting Data with SimpleDateFormat

My problem is this: I have JTable with several populated columns with data pulled from my database. Some of these columns are time values, for example, 0834 is pulled from the database and I would like it to be displayed 08:34...
asked by 17.11.2016 / 03:40
2
answers

Add line in JTable when clicking the button

I'm starting to create an interface in Java, an example I'm trying to do is to have a form with textField nome and email , and clicking the Enviar button will% for my textField , but I am not able to manipulate my ta...
asked by 30.03.2016 / 20:37