Solved

JTable question again

Posted on 2002-07-14
3
196 Views
Last Modified: 2010-03-31
Hi,
How can I make the JTable in a JScrollPane uses up all the spaces in the JScrollPane?

0
Comment
Question by:stanleyhuen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:s_lavie
ID: 7156658
What do you mean by using up all the spaces in the JScrollPane?
0
 
LVL 3

Expert Comment

by:yasser_helmy
ID: 7156938
hi stanleyhuen,
try
JScrollPane scroll=new JScrollPane();
JTable t=new JTable();
scroll.setViewportView(t);

Is this what you are asking for? send me comments, please.
0
 
LVL 3

Accepted Solution

by:
yasser_helmy earned 100 total points
ID: 7156944
..
If you don't want the scrollbar use
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);

hope it helps..
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question