• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add scrolling Functionality to a JButton?

 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I am new in Swing application. I need to add scrolling functionality to JButton...

I will explain the scenario.

I have a panel with many labels. And I have two button, one for up scrolling and one for down scrolling.

What I need is, when I click on these button the panel have to scroll correspondingly (The Panel is already added to a JFrame).

Thanks in Advance..
Renjith M

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> I need to add scrolling functionality to JButton...

Why?

add the panel to a JScollpane, add the scrollpane to the frame,
then use them scrollpane's buttons for up/down
 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael,

I don't need to add the panel to the ScrollPane, I need to integrate the scrolling functionality to a JButton....

Thanks again Michael..
 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Renjith tvm wrote:Thanks Michael,

I don't need to add the panel to the ScrollPane.
I need to integrate the scrolling functionality to a JButton, with out using the JScrollPane class....

Thanks again Michael..
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> I don't need to add the panel to the ScrollPane, I need to integrate the scrolling functionality to a JButton....

if you don't want to use the correct tool for the job, then simply reset the bounds

and if you don't know what this means, you've reached your peter principle
 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic