public TaskGraphComponent(ProjectFrame proFrame,TaskGraphModel model, painter) {
this.proFrame = proFrame;
_painter = painter;
setModel(model);
_mouseHandler = new GraphMouseHandler(this);
_verticalScroll = new JScrollBar(JScrollBar.VERTICAL);
this.add(_verticalScroll, BorderLayout.EAST);
_verticalScroll.addAdjustmentListener(this);
_verticalScroll.setVisible(true);
_horizontalScroll = new JScrollBar(JScrollBar.HORIZONTAL);
add(_horizontalScroll, BorderLayout.SOUTH);
_horizontalScroll.addAdjustmentListener(this);
_horizontalScroll.setVisible(true);
setBorder(BorderFactory.createEmptyBorder(0,0,15,0));
this.addMouseMotionListener(_mouseHandler);
this.addMouseListener(_mouseHandler);
this.addMouseWheelListener(_mouseHandler);
this.addKeyListener(_mouseHandler);
this.addComponentListener(this);
this.setFocusable(false);
ToolTipManager.sharedInstance().setDismissDelay(8000);
ToolTipManager.sharedInstance().setReshowDelay(3000);
}
我從擴展JComponent的這裏垂直滾動條工作正常,但水平 滾動沒有顯示。揮杆水平滾動條問題
這裏TaskGraphComponent的是Jcomponent
試試這個[示例](http://www.java2s.com/Code/Java/Swing-JFC/AquickdemonstrationofJScrollBarbothverticalandhorizontal.htm)。 –
@Asad拉希德其實我累了信息存在聯繫,但同樣的問題 – Ganesh
什麼是,似乎你不使用的佈局? –