View unanswered posts | View active topics It is currently Fri Nov 28, 2014 4:02 pm



This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
 JTable header not showing when using MigLayout 
Author Message

Joined: Wed Jun 16, 2010 3:42 am
Posts: 1
Post JTable header not showing when using MigLayout
Hi,

I am just starting using MigLayout, but when doing a simple panel.add(jtable) where the layout manager is MigLayout the contents rows of the jtable are shown, but the header row is not.

Does anyone have an idea of why this is happening?

Many thanks
C


Wed Jun 16, 2010 4:50 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: JTable header not showing when using MigLayout
Hello,

MigLayout only sets the bounds of the component so the layout manager shouldn't matter.

Cheers,
Mikael


Wed Jun 16, 2010 8:29 pm
Profile WWW

Joined: Tue Aug 31, 2010 5:58 pm
Posts: 1
Post Re: JTable header not showing when using MigLayout
I experienced the same problem.

/** This code snippet did not show Table headers */
private void layoutUI() {
LayoutManager layoutMgr = new MigLayout();
this.setLayout(layoutMgr);
this.add(new JScrollPane(myTable));
}

/** This code snippet shows Table headers */
private void layoutUI() {
LayoutManager layoutMgr = new BoxLayout(this, BoxLayout.Y_AXIS);
this.setLayout(layoutMgr);
this.add(new JScrollPane(myTable));
}


Tue Aug 31, 2010 6:05 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: JTable header not showing when using MigLayout
OK, I'll have a look at it.

Cheers,
Mikael


Tue Aug 31, 2010 7:45 pm
Profile WWW
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: JTable header not showing when using MigLayout
Hello,

Sorry for the long time but I finally got some time to work on MigLayout.

This code seems to work for me.

Code:
public class TestMigLayout
{
   public static void main(String[] args)
   {
      JFrame frame = new JFrame();
      frame.setLayout(new MigLayout());
      JComponent table = new JTable(10, 10);
      frame.add(new JScrollPane(table));
      frame.pack();
      frame.setVisible(true);
   }
}


Cheers,
Mikael


Mon Jan 31, 2011 12:35 am
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.