• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where are you adding the table? Your code does not mention to any table.
Try
 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using these lines of code




ScreenShot.GIF
Screen SHot For JTabel
[Thumbnail for ScreenShot.GIF]
 
Rob Spoor
Sheriff
Pie
Posts: 20369
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TicketFixingReportPanel is using a FlowLayout, which by default centers components. Try changing that into a BorderLayout.
 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to All,

BorderLayout worked.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic