Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 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
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using these lines of code




ScreenShot.GIF
[Thumbnail for ScreenShot.GIF]
Screen SHot For JTabel
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to All,

BorderLayout worked.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!