当用户将光标移到边框的边缘时JScrollPane
,我可以将光标变成两个指向彼此相反方向的小箭头,从而用户可以缩小或扩大整个JScrollPane
?
JScrollPane scrollPane = new JScrollPane(buddyList,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
layoutConstraints.gridx = 0; layoutConstraints.gridy = 0;
layoutConstraints.gridwidth = 3; layoutConstraints.gridheight = 8;
layoutConstraints.fill = GridBagConstraints.BOTH;
layoutConstraints.insets = new Insets(10, 6, 10, 36);
layoutConstraints.anchor = GridBagConstraints.NORTHWEST;
layoutConstraints.weightx = 0.8; layoutConstraints.weighty = 1.0;
layout.setConstraints(scrollPane, layoutConstraints);
add(scrollPane);//Adds the Scrollpane straight to the panel The class extends JPanel