/** * Set the value of content * * @param newVar the new value of content */ private void setContent(final counts a, final connections cnc_a) { // Creates a new container content = frame.getContentPane(); // sets the layout content.setLayout(new BorderLayout()); this.setTaskbar(); // sets the taskbar // adding the taskbar to the bottom-part content.add(taskbar, BorderLayout.SOUTH); this.setDraw_pad(a, cnc_a, this.getTaskbar()); // sets the drawPad JScrollPane Padscroller = new JScrollPane(); Padscroller.setWheelScrollingEnabled(true); Padscroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); Padscroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); Padscroller.setPreferredSize(new Dimension(200, 100)); // Padscroller.setMinimumSize(new Dimension(200, 100)); // Padscroller.setMaximumSize(new Dimension(200, 100)); Padscroller.setViewportView(drawPad); content.add(Padscroller, BorderLayout.CENTER); this.setPanel(a, cnc_a); // sets the panel JScrollPane scroller = new JScrollPane(panel); scroller.setWheelScrollingEnabled(true); scroller.setPreferredSize(new Dimension(125, 80)); scroller.setMinimumSize(new Dimension(125, 80)); scroller.setMaximumSize(new Dimension(125, 80)); // sets the scroller to the west portion content.add(scroller, BorderLayout.WEST); // content.add(panel, BorderLayout.WEST); }