本文整理汇总了Java中java.awt.peer.ScrollPanePeer.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPanePeer.setValue方法的具体用法?Java ScrollPanePeer.setValue怎么用?Java ScrollPanePeer.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.ScrollPanePeer
的用法示例。
在下文中一共展示了ScrollPanePeer.setValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: adjustmentValueChanged
import java.awt.peer.ScrollPanePeer; //导入方法依赖的package包/类
/**
* Invoked when the value of the adjustable has changed.
*/
public void adjustmentValueChanged(AdjustmentEvent e) {
Adjustable adj = e.getAdjustable();
int value = e.getValue();
ScrollPanePeer peer = (ScrollPanePeer) scroller.peer;
if (peer != null) {
peer.setValue(adj, value);
}
Component c = scroller.getComponent(0);
switch(adj.getOrientation()) {
case Adjustable.VERTICAL:
c.move(c.getLocation().x, -(value));
break;
case Adjustable.HORIZONTAL:
c.move(-(value), c.getLocation().y);
break;
default:
throw new IllegalArgumentException("Illegal adjustable orientation");
}
}
示例2: adjustmentValueChanged
import java.awt.peer.ScrollPanePeer; //导入方法依赖的package包/类
/**
* Invoked when the value of the adjustable has changed.
*/
@SuppressWarnings("deprecation")
public void adjustmentValueChanged(AdjustmentEvent e) {
Adjustable adj = e.getAdjustable();
int value = e.getValue();
ScrollPanePeer peer = (ScrollPanePeer) scroller.peer;
if (peer != null) {
peer.setValue(adj, value);
}
Component c = scroller.getComponent(0);
switch(adj.getOrientation()) {
case Adjustable.VERTICAL:
c.move(c.getLocation().x, -(value));
break;
case Adjustable.HORIZONTAL:
c.move(-(value), c.getLocation().y);
break;
default:
throw new IllegalArgumentException("Illegal adjustable orientation");
}
}
示例3: adjustmentValueChanged
import java.awt.peer.ScrollPanePeer; //导入方法依赖的package包/类
/**
* Invoked when the value of the adjustable has changed.
*/
public void adjustmentValueChanged(AdjustmentEvent e) {
Adjustable adj = e.getAdjustable();
int value = e.getValue();
ScrollPanePeer peer = (ScrollPanePeer) scroller.peer;
if (peer != null) {
peer.setValue(adj, value);
}
Component c = scroller.getComponent(0);
switch(adj.getOrientation()) {
case Adjustable.VERTICAL:
c.move(c.getLocation().x, -(value));
break;
case Adjustable.HORIZONTAL:
c.move(-(value), c.getLocation().y);
break;
default:
throw new IllegalArgumentException("Illegal adjustable orientation");
}
}