Questions tagged [jtableheader]

JTableHeader is the Swing component which manages the header of the JTable.

JTableHeader is the Swing component which manages the header of the JTable. It displays the column headers and unlike other rows stays visible on top as the table scrolls vertically in JScrollPane.

JTableHeader also handles resizing, rearrangement and sorting of columns in response to mouse inputs.

201 questions
2
votes
5 answers

Column header name in JTable, Java

I am filling a JTable with data from a database. I am have subclassed AbstractTableModel and passed the reference to the JTable. However, how do I manage to extract the column names in the database and set them as "headers" in the JTable? Thanks in…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
2
votes
1 answer

Custom TableHeaderUI breaks custom TableRowSorter

I wrote a custom TableRowSorter that changes the sort order when you click on a JTableHeader fromSortOrder.UNSORTED => SortOrder.ASCENDING => SortOrder.DESCENDING => SortOrder.ASCENDING => SortOrder.DESCENDING => ...toSortOrder.UNSORTED =>…
Dan
  • 7,286
  • 6
  • 49
  • 114
2
votes
1 answer

Setting JTableHeader holder background colour

I have a JTable in my program and I wanted to change the color of the JTableHeader. I did this using the following code JTableHeader header = table.getTableHeader(); header.setBackground(Color.WHITE); However, when I dragged the header, I noticed…
Dan
  • 7,286
  • 6
  • 49
  • 114
2
votes
1 answer

Can't show table header of tabbed JTable

I have a JTabbedPane, which contains three tables in its tabs. The JTabbedPane, again, is in a JScrollPane. I want to show a fix table header, which is following the schema {"Client", "Action", "Location", "Value"}, for each table. While I was…
KJaeg
  • 698
  • 3
  • 7
  • 23
2
votes
1 answer

Jtable, issues with displaying sorting icon TableHeader with custom renderer and system L&F

I created a custom renderer to my JTabe header but after sorting the table, the sorting icon does not appear when I'm using the default system L&F (in my case windows 8) but the icon appears when I use the Java L&F. With Java L&F: With System…
SlimenTN
  • 3,383
  • 7
  • 31
  • 78
2
votes
1 answer

Groupable table header with filter below header

Problem I'd like to create a groupable table header with a filter row below the header. I guess the straightforward approach would be to include the filter components in the header. The problem is that the components aren't editable. I searched, but…
Roland
  • 18,114
  • 12
  • 62
  • 93
2
votes
3 answers

Get Location of JTable Header in JFrame

Here is an image of my application: As you can see, there is a JTable in there. I need to get the location of the headers of the JTable relative to the JFrame that it is in. Why might I be doing this? I am adding a help feature that explains what…
user489041
  • 27,916
  • 55
  • 135
  • 204
2
votes
4 answers

Table Header is not displaying on Java Swing

I add full code Here. Check the following code which I am using to create the table. While executing the program, Values are displaying clearly, but the header is not displaying. public class Table extends JFrame implements ActionListener { …
Shaji SS
  • 102
  • 1
  • 2
  • 10
2
votes
0 answers

Scroll the JTABLE content with fixed header

I am working with jtable scroll in content. I have a code here , The issue is i want to bring the style of 'jtable tbody' to my table's tbody script var oTbl; var newTbl; function scrolify(tblAsJQueryObject, height) { debugger; …
Krishna
  • 1,332
  • 5
  • 20
  • 35
2
votes
0 answers

JTable jquery, Close Child button

I am using Jtable (Jquery based). I have some trouble with the child table. In the child table I added a new button in the toolbar. With this new button in the toolbar, che close icon disappear, how can I fix it? (if I remove the toolbar element the…
Nk SP
  • 822
  • 4
  • 19
  • 37
2
votes
1 answer

JTable- How to change Font for a specific column header

I want to change the font for the header of the selected column on JTable. I tried to do that on my ColumnHeaderRenderer as follow : public class ColumnHeaderRenderer extends JLabel implements TableCellRenderer { public ColumnHeaderRenderer(JTable…
blackbishop
  • 30,945
  • 11
  • 55
  • 76
2
votes
1 answer

JTable header background color

I'm trying to put background color on the JTable header but it seems that it doesnt change the header's color this is my code for my JTable.. what am I doing wrong? Color headerColor = new Color(25, 78, 132); itemTable = new JTable(){ …
Criz
  • 77
  • 4
  • 12
2
votes
8 answers

How to hide the title from JTable by using Netbeans GUI design?

I need to hide the title bar from JTable? So I need only row and columns without any actual name to show touser? Is there any other swing to do the similar thing? I can not add jTable1.setTableHeader(null); anywhere inside initComponents function…
Bernard
  • 4,240
  • 18
  • 55
  • 88
2
votes
1 answer

JScrollPane breaking right to left orientation

My application is divided up into into two main components: a header consisting of a JLabel and JTableHeader a JScrollPane containing a JTable The reason the JTableHeader is in a separate panel is because it should not scroll. The columns in the…
nevets1219
  • 7,692
  • 4
  • 32
  • 47
2
votes
3 answers

I am not getting names of column

I am placing a JTable in a JPanel, but when I am displaying, I see the table contents but not the column names. public class Neww extends JPanel { Connection conn = null; Statement st; DefaultTableModel model = new DefaultTableModel(new…