This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • 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
  • 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: 11021
12
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
Screen SHot For JTabel
[Thumbnail for ScreenShot.GIF]
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
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