int () { JScrollBar scrollbar = myScrollPane.getHorizontalScrollBar(); if (scrollbar != null) { BoundedRangeModel model = scrollbar.getModel(); if (model != null) { return model.getValue() + model.getExtent(); } } return 0; }