Samer
Samer

Reputation: 161

Jtable header size in netbeans

Hi Guys i ve this Table in Netbeans and the Data it comes from the database i have many rows so i activate a scrollbar but the problem stays in the Title this is the Problem enter link description here

and i wanna the Result be like that enter link description here any solutions ? Please

Upvotes: 0

Views: 620

Answers (2)

kegs Production
kegs Production

Reputation: 67

try this code:

table_name.getColumnModel().getColumn(0).setPreferredWidth(474);

Upvotes: 0

camickr
camickr

Reputation: 324108

If you are trying to size the width of the columns then check out Table Column Adjuster

It allows you to size the columns based on:

  1. the header width
  2. the data width
  3. maximum of header or data

Upvotes: 1

Related Questions