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
0
votes
1 answer

How to create a JButton inside JTable header with clicking visual effect?

Tried everything but I cannot get a JButton inside a JTable header. I was able to make it show there and use a mouse listener to trap clicks, but there is no visual clicking effect. Can someone provide a simple example with the right way of doing…
chrisapotek
  • 6,007
  • 14
  • 51
  • 85
0
votes
1 answer

I have filled my jtable using following code but i m not able to set header of the column of the table

ResultSet rs = statment.executeQuery(); table.setModel(DbUtils.resultSetToTableModel(rs));
0
votes
1 answer

Why setTableHeader() method throws NullPointerException?

I try to add tooltips to my JTable header. In this case I use TTHeader class which extends JTableHeader Java class. Everything it seems to be fine, but when I try to add new TTHeader header to my JTable, than I get NullPointerException with Unknown…
bluevoxel
  • 4,978
  • 11
  • 45
  • 63
0
votes
1 answer

Column of JTable out of place after DragGestureEvent's startDrag call

I have implemented drag and drop for JTableHeader so when the user clicks the header of a table having Ctrl pressed instead of reordering the columns a custom object is transferred. It looks to work properly, but when the DragGestureEvent's…
Igor Rodriguez
  • 1,196
  • 11
  • 16
0
votes
2 answers

How to add a function in jTable that sorts the column?

I know that by using JTable the column is sorted when we click on the column heading, but what I want is that, when I right-click on the column name a function name 'sort' should be displayed. Any suggestion in doing it?
Saumil
  • 2,521
  • 5
  • 32
  • 54
0
votes
1 answer

change column names after refreshing JTable java

I dont know why column names are named "A","B","C" ... after refreshing JTable. I created a class to refresh JTable. public class TableModelClass extends AbstractTableModel { Object[][] data; Object[] title; public…
szefu
  • 551
  • 1
  • 5
  • 11
0
votes
0 answers

JTable headings not scrolling when horizontally scrolling

I have a jtable with about 15 columns with different widths. Every thing is going well though when I scroll horizontally table headings are not moving with its data columns. My Code : …
Mahesh
  • 109
  • 1
  • 2
  • 12
0
votes
1 answer

JTable Not Showing Up In JPanel

I'm trying to create a JTable with the column headers defined in colName using a DefaultTableModel, then adding the table to a JScrollPane then to a JPanel. However, when I add the panel to my JFrame, only the panel shows up, not the table. I am…
0
votes
1 answer

Fill a Swing table with some data from MySQL DB

I need to fill a Swing table with some data from MySQL DB. The problem is that the table does not display all the columns (i.e. a.aircraftType and b.aircraftCategory). In Debug mode I checked that the query returns correct data. So, why finally some…
Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217
0
votes
2 answers

can't show JTable

I'm using code from internet to create Groupable TableHeader, i followed all the steps but i dont know why my Jtable is not showing up!! I'm using netbeans to generate IHM, can anyone help me to find why Jtable is not showing ? NB: OnLoad of the…
archavin
  • 313
  • 2
  • 5
  • 12
0
votes
1 answer

JTable column names displayed wrong

I want to display some things in a JTable. The problem is that the JTable columnnames are "A", "B", "C", ... my code is like this: import javax.swing.JTable; public class View extends JFrame implements Observer { private JTable contentTable; …
0
votes
1 answer

table headers not showing up on top of table

I am making a JTable and I am having 2 problems. #1 the table headers are showing up on the side of the table and #2 the scroll pane isn't showing up. This is some of my code right now. String [] data = {"a", "b", "c", "d", "e"}; JFrame frame = new…
user2007843
  • 609
  • 1
  • 12
  • 30
0
votes
1 answer

TableHeaderRenderer with Nimbus

I'm have a custom table header renderer that will have the standard label and a button inside a JComponent. The issue I'm having is with the label returned by the default renderer. The call to the default renderer provides the standard label. If I…
Dodd10x
  • 3,344
  • 1
  • 18
  • 27
0
votes
3 answers

Is possible to associate a text to a JTableHeader without a table?

I want to create a JTable with a header inside some cells. But I want to associate a text with this header. Is it possible? How to do? All my best! Leandro Lima
Leandro Lima
  • 1,140
  • 3
  • 24
  • 42
0
votes
2 answers

Is there any way to add a JPanel to a header in a JTable?

I want to add a JPanel to a column header of the JTable. Searched a lot, but could not find any answer. Please help me on this. Thank you.