• Post Reply Bookmark Topic Watch Topic
  • New Topic

resolution problem in JTable

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a doubt in JTable. i created one long JTable.it can display correctly.but i can change the resolution in windows XP operating system, the whole table is not displayed properly.. i mean cut off at the top and bottom sides.

1280x1024 – table with print, ok buttons are displayed with loss of some information
1024x768 – table displayed with print and ok buttons are not displayed.

How can i resolve this problem any idea ??

thanks in advance..
screen-2.GIF
[Thumbnail for screen-2.GIF]
 
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
More information please.
1) Are you changing the resolution while the table is being displayed? If yes, can you close the UI, change the resolution and bring up the UI again? Does it make any difference?
2) Are you any using layout manager for your table's parent container? If yes, which one?
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here attached another screen shot...
screen-1.GIF
[Thumbnail for screen-1.GIF]
 
K. Tsang
Bartender
Posts: 3604
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem may not necessarily your JTable. Given you change your screen resolution while the GUI is opened may indeed affect the resizing.

As Maneesh indicated are you using layout managers? is the JTable inside a JScrollPane? Are the table columns auto-resized using JTable's setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);? is the scrollable view set JTable's setPreferredScrollableViewportSize(new Dimension(width, height));? If all these are done then you should be fine.
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a large panel in which i want to display a jtable along with some labels and two buttons named print and cancel on it.here i have used border layout for the panel.i am changing the resolution after the rows can be filled into the table.i attached the screen shots so that you got some idea.i am using windows xp operating system.
1280x1024 – table with print, ok buttons are displayed by lables and butttons info not
1024x768 – table with print and ok buttons are not displayed
 
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
One does not really need to play around with the viewport size if the table/scrollpane is added to a container with a borderlayout
 
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
tadi raja wrote:i am changing the resolution after the rows can be filled into the table.i attached the screen shots so that you got some idea.i am using windows xp operating system.

Did you try out #1 I suggested above?
 
K. Tsang
Bartender
Posts: 3604
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You better post some code. I personally don't believe the resolution would make some components disappear.
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi K. Tsang ,
Here attched the code ...
[MG]Edited to remove tons of unformatted code.
 
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
Tadi Raja,
You have been requested before too, to use the code tags. You have also been requested to post code which people can try out

I have edited your post and removed numerous lines of code which was against both these suggestions. Please take care while posting your code in future.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!