本文整理了Java中javax.swing.JTextField.getHorizontalVisibility()
方法的一些代码示例,展示了JTextField.getHorizontalVisibility()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.getHorizontalVisibility()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:getHorizontalVisibility
暂无
代码示例来源:origin: org.tentackle/tentackle-swing
/**
* Update the visibility model with the associated JTextField
* (if there is one) to reflect the current visibility as a
* result of changes to the document model. The bounded
* range properties are updated. If the view hasn't yet been
* shown the extent will be zero and we just set it to be full
* until determined otherwise.
*/
void updateVisibilityModel() {
Component c = getContainer();
if (c instanceof JTextField) {
JTextField field = (JTextField) c;
BoundedRangeModel vis = field.getHorizontalVisibility();
int hspan = (int) getPreferredSpan(X_AXIS);
int extent = vis.getExtent();
int maximum = Math.max(hspan, extent);
extent = (extent == 0) ? maximum : extent;
int value = maximum - extent;
int oldValue = vis.getValue();
if ((oldValue + extent) > maximum) {
oldValue = maximum - extent;
}
value = Math.max(0, Math.min(value, oldValue));
vis.setRangeProperties(value, extent, 0, maximum, false);
}
}
代码示例来源:origin: stackoverflow.com
final JTextField textField = new JTextField(TEXT);
JScrollBar scroller = new JScrollBar(JScrollBar.HORIZONTAL);
scroller.setModel(textField.getHorizontalVisibility());
代码示例来源:origin: stackoverflow.com
scroller.setModel(textField.getHorizontalVisibility());
代码示例来源:origin: org.tentackle/tentackle-swing
if (c instanceof JTextField) {
JTextField field = (JTextField) c;
BoundedRangeModel vis = field.getHorizontalVisibility();
int max = Math.max(hspan, bounds.width);
int value = vis.getValue();
内容来源于网络,如有侵权,请联系作者删除!