Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ContentPane extends JTabbedPane {
- private InfoPanel ip;
- ScrollPanel sp;
- public InfoPanel getIp() {
- return ip;
- }
- public ContentPane(GraphPanel gp) {
- this.sp = new ScrollPanel(gp);
- this.sp.setViewportView(gp);
- this.addTab("Graph", this.sp);
- this.ip = new InfoPanel(gp);
- this.addTab("Info", ip);
- }
- }
- public class ScrollPanel extends JScrollPane {
- public ScrollPanel(GraphPanel gp){
- this.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
- this.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
- this.repaint();
- }
- }
- public GraphPanel(StatusBar sb) {
- this.sb = sb;
- zoomLevel = 5;
- sm = new Simulation();
- mh = new MouseHandler(this, sm);
- this.addMouseListener(mh);
- this.setBackground(new Color(240, 165, 98));
- this.repaint();
- }
- public class ScrollPanel extends JScrollPane {
- public ScrollPanel(GraphPanel gp){
- // :::: HERE ::: you are not doing anything with gp
- // like this.setViewPort( gp ) or something like that
- this.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
- this.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
- this.repaint();
- }
- }
- public class ScrollPanel extends JScrollPane {
- public ScrollPanel(GraphPanel gp){
- super( gp );
- .... etc ...
Add Comment
Please, Sign In to add comment