aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable rows are getting visible in the middile of the JFrame only Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable rows are getting visible in the middile of the JFrame only" Watch "JTable rows are getting visible in the middile of the JFrame only" New topic
Author

JTable rows are getting visible in the middile of the JFrame only

buntha Choudhary
Ranch Hand

Joined: Jul 03, 2009
Posts: 136

I am extending the JFrame and trying to add the JTable in a JPanel with the help of JScrollPane.





Above is the part of example and for above I am getting the out as the rows are gettin populated only on middle area of the JFrame cutting the left pary as well as the right part of the JFrame. If I am trying to add the JScrollPane directly to the JFrame , then it the output is fine.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Where are you adding the table? Your code does not mention to any table.
Try


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
buntha Choudhary
Ranch Hand

Joined: Jul 03, 2009
Posts: 136

I am using these lines of code







[Thumbnail for ScreenShot.GIF]

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

TicketFixingReportPanel is using a FlowLayout, which by default centers components. Try changing that into a BorderLayout.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
buntha Choudhary
Ranch Hand

Joined: Jul 03, 2009
Posts: 136

Thanks to All,

BorderLayout worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable rows are getting visible in the middile of the JFrame only