本文整理汇总了Java中javax.swing.JScrollBar.setOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollBar.setOrientation方法的具体用法?Java JScrollBar.setOrientation怎么用?Java JScrollBar.setOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollBar
的用法示例。
在下文中一共展示了JScrollBar.setOrientation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeImpl
import javax.swing.JScrollBar; //导入方法依赖的package包/类
@Override
void initializeImpl() {
super.initializeImpl();
final Scrollbar target = getTarget();
setLineIncrement(target.getUnitIncrement());
setPageIncrement(target.getBlockIncrement());
setValues(target.getValue(), target.getVisibleAmount(),
target.getMinimum(), target.getMaximum());
final int orientation = target.getOrientation();
final JScrollBar delegate = getDelegate();
synchronized (getDelegateLock()) {
delegate.setOrientation(orientation == Scrollbar.HORIZONTAL
? Adjustable.HORIZONTAL
: Adjustable.VERTICAL);
delegate.addAdjustmentListener(this);
}
}
示例2: loadScene
import javax.swing.JScrollBar; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void loadScene(Container container) {
JButton btnNextScene = new JButton("NEXT SCENE");
btnNextScene.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
SimpleTest.window.loadScene(new SceneText());
}
});
btnNextScene.setBounds(21, 409, 128, 41);
container.add(btnNextScene);
JLabel lblImAJlabel = new JLabel("I'm a JLabel!");
lblImAJlabel.setFont(new Font("Tahoma", Font.PLAIN, 17));
lblImAJlabel.setHorizontalAlignment(SwingConstants.CENTER);
lblImAJlabel.setBounds(30, 59, 208, 49);
container.add(lblImAJlabel);
JComboBox comboBox = new JComboBox();
String[] arr = new String[150];
for (int i = 0; i < arr.length; i++) {
arr[i] = i + "";
}
comboBox.setModel(new DefaultComboBoxModel(arr));
comboBox.setBounds(48, 184, 190, 113);
container.add(comboBox);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(384, 59, 251, 197);
container.add(scrollPane);
JTextPane txtpnTextpane = new JTextPane();
txtpnTextpane.setText("TextPane!");
scrollPane.setViewportView(txtpnTextpane);
JScrollBar scrollBar = new JScrollBar();
scrollBar.setOrientation(JScrollBar.HORIZONTAL);
scrollBar.setBounds(131, 361, 365, 40);
container.add(scrollBar);
table = new JTable();
table.setModel(new DefaultTableModel(new Object[][] { { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, { null, null, null, null, null, null, null, null },
{ null, null, null, null, null, null, null, null }, },
new String[] { "New column", "New column", "New column", "New column", "New column", "New column",
"New column", "New column" }));
table.setBounds(506, 287, 252, 128);
container.add(table);
JTree tree = new JTree();
tree.setBounds(248, 11, 107, 139);
container.add(tree);
}