本文整理汇总了Java中edu.mit.blocks.codeblockutil.CScrollPane.ScrollPolicy.HORIZONTAL_BAR_NEVER属性的典型用法代码示例。如果您正苦于以下问题:Java ScrollPolicy.HORIZONTAL_BAR_NEVER属性的具体用法?Java ScrollPolicy.HORIZONTAL_BAR_NEVER怎么用?Java ScrollPolicy.HORIZONTAL_BAR_NEVER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类edu.mit.blocks.codeblockutil.CScrollPane.ScrollPolicy
的用法示例。
在下文中一共展示了ScrollPolicy.HORIZONTAL_BAR_NEVER属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GlassCard
/**
* constructor
* @param i
* @param canvas
* @param ex
*/
GlassCard(int i, Canvas canvas, GlassExplorer ex) {
this.index = i;
this.explorer = ex;
this.canvas = canvas;
this.button = new GlassButton(canvas.getColor(), canvas.getColor().brighter().brighter().brighter(), canvas.getName());
//this.button.setMaximumSize(new Dimension(0,10));
//this.button.setPreferredSize(new Dimension(0,10));
this.scroll = new CGlassScrollPane(
canvas.getJComponent(),
ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
ScrollPolicy.HORIZONTAL_BAR_NEVER,
SCROLLBAR_WIDTH, canvas.getColor(),
new Color(100, 100, 100, 100));
canvas.getJComponent().setOpaque(false);
button.addActionListener(this);
canvas.getJComponent().addPropertyChangeListener(this);
this.scroll.setPreferredSize(
new Dimension(canvas.getJComponent().getPreferredSize().width + SCROLLBAR_WIDTH,
canvas.getJComponent().getPreferredSize().height));
}
示例2: PopupExplorer
/**
* Constructor
*/
public PopupExplorer() {
super();
this.components = new ArrayList<Canvas>();
this.setLayout(null);
this.setOpaque(true);
this.setBackground(Color.GRAY);
this.viewport = new JPanel(new BorderLayout());
scroll = new CHoverScrollPane(
viewport,
ScrollPolicy.VERTICAL_BAR_ALWAYS,
ScrollPolicy.HORIZONTAL_BAR_NEVER,
20, Color.blue, new Color(0, 0, 50));
add(scroll, JLayeredPane.DEFAULT_LAYER);
setLayer(scroll, JLayeredPane.DEFAULT_LAYER, 0);
buttonPane = new ButtonPanel();
add(buttonPane, JLayeredPane.PALETTE_LAYER);
setLayer(buttonPane, JLayeredPane.PALETTE_LAYER, 0);
this.addComponentListener(this);
}
示例3: CPopupMenu
CPopupMenu() {
super();
this.setLayout(new BorderLayout());
this.setBackground(background);
this.setOpaque(false);
this.removeAll();
this.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, CGraphite.blue));
view = new JPanel(new GridLayout(0, 1));
view.setBackground(background);
scroll = new CTracklessScrollPane(view,
ScrollPolicy.VERTICAL_BAR_AS_NEEDED,
ScrollPolicy.HORIZONTAL_BAR_NEVER,
9, CGraphite.blue, background);
this.add(scroll);
}
示例4: CWheeler
public CWheeler(Collection<JComponent> items, boolean includeScrollbar, Color backgroundColor) {
super(new BorderLayout());
this.setBackground(backgroundColor);
this.elements = items;
if (includeScrollbar) {
CArrowButton left = new CArrowButton(CArrowButton.Direction.WEST) {
private static final long serialVersionUID = 328149080242L;
@Override
public void triggerAction() {
scrollLeft();
}
};
left.addActionListener(left);
left.setPreferredSize(new Dimension(15, 15));
CArrowButton right = new CArrowButton(CArrowButton.Direction.EAST) {
private static final long serialVersionUID = 328149080243L;
@Override
public void triggerAction() {
scrollRight();
}
};
right.addActionListener(right);
right.setPreferredSize(new Dimension(15, 15));
this.view = new JPanel(null);
this.view.setBackground(backgroundColor);
this.scroll = new CHoverScrollPane(view,
ScrollPolicy.VERTICAL_BAR_NEVER,
ScrollPolicy.HORIZONTAL_BAR_ALWAYS,
20, CGraphite.blue, new Color(0, 0, 50));
JPanel leftPane = new JPanel(new BorderLayout());
leftPane.setBackground(backgroundColor);
leftPane.add(left, BorderLayout.SOUTH);
this.add(leftPane, BorderLayout.WEST);
JPanel rightPane = new JPanel(new BorderLayout());
rightPane.setBackground(backgroundColor);
rightPane.add(right, BorderLayout.SOUTH);
this.add(rightPane, BorderLayout.EAST);
} else {
this.view = new JPanel(null);
this.view.setBackground(backgroundColor);
this.scroll = new CTracklessScrollPane(view,
ScrollPolicy.VERTICAL_BAR_NEVER,
ScrollPolicy.HORIZONTAL_BAR_NEVER,
20, Color.blue, new Color(0, 0, 50));
}
for (JComponent element : elements) {
view.add(element);
}
this.add(scroll, BorderLayout.CENTER);
reformItems();
}