• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with scroll pane!!!

Mahesh swami
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a problem related to JScrollPane
I dont want the scrollpane to scroll on receiving the key events like UP key and down key.FOr this I override the method installKeyBoardAction() in BasicScrollBarUI() and gave an empty implementation. Now it works fine.But borders of the scrollbars are not displayed now.Can any one help me.I am pasting the sample code also.
import javax.swing.*;
import java.awt.*;
import javax.swing.plaf.basic.*;
public class Scroll extends JFrame{
public Scroll(){
JPanel pan = new JPanel();
pan.setPreferredSize(new Dimension(500,500));
JScrollPane pane = new JScrollPane(pan);
MyUI ui = new MyUI();
MyUI ui1 = new MyUI();
public static void main(String args[]){
new Scroll();
class MyUI extends BasicScrollBarUI{
protected void installKeyboardActions() {
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic