Solved

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

Posted on 2004-08-01
5
235 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse java  build path 6 57
tomcat administrtor 12 47
hibernate example for saving data 19 42
String array comparison 4 34
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

777 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