Solved

JTable question again

Posted on 2002-07-14
3
192 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HashMap Vs TreeMap 12 55
java. non-English characters encoding problem. intellij idea 3 73
Where to store the queries for modification of table 4 53
ForLoop Example 3 40
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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now