Solved

How do I make a component visible in the left lower corner of a JScrollPane?

Posted on 2004-08-01
5
248 Views
Last Modified: 2010-03-31
I created some JScrollPane's with widened scrollbars to dimension space for a button on the lower right corner.
Now I need to add a second button. As the corner object has to be a Component, I can't put a JPanel with 2 buttons
in there.
So the second button goes to the other corner:

        scrollPane.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, firstButton);
        scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, secondButton);

As I don't really need a row header in there, how do I make that button visible
and how do I dimension space for it?

;JOOP!
0
Comment
Question by:sciuriware
  • 3
  • 2
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 11691299
A JPanel is a subclass of Component so it can be used.
0
 
LVL 24

Author Comment

by:sciuriware
ID: 11691331
You're right, but in this case it doesn't work: however big the space in the corner, you'll see only 1 button.
Maybe there's a simple solution to it, but as the vertical scrollbar must be widened to "elderly-people-with-sight-problems"
measures, I'd prefer the button on the left.
Any suggestion?

;JOOP!
0
 
LVL 24

Author Comment

by:sciuriware
ID: 11691479
     setRowHeaderView(rowHeader = new JLabel());
      rowHeader.setPreferredSize(new Dimension(width, Integer.MAX_VALUE));

does the job!

;JOOP!
0
 
LVL 92

Expert Comment

by:objects
ID: 11691508
good stuff :)
0
 
LVL 24

Author Comment

by:sciuriware
ID: 11691524
I'm not sure and I don't have the time, but I guess setting a fixed size on the JPanel would at least
have done something useful.
So, because I forgot that implication, you are getting your points.
;JOOP!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error in @AspectJ Based AOP with Spring 2 23
Chrome and Firefox Java 5 66
SequenceInputStream example 3 21
swing controls 2 21
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

680 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