Tabnine Logo
ScrollBar.setVisibleAmount
Code IndexAdd Tabnine to your IDE (free)

How to use
setVisibleAmount
method
in
javafx.scene.control.ScrollBar

Best Java code snippets using javafx.scene.control.ScrollBar.setVisibleAmount (Showing top 3 results out of 315)

origin: org.fxmisc.flowless/flowless

@Override
protected void layoutChildren() {
  double layoutWidth = getLayoutBounds().getWidth();
  double layoutHeight = getLayoutBounds().getHeight();
  boolean vbarVisible = vbar.isVisible();
  boolean hbarVisible = hbar.isVisible();
  double vbarWidth = vbarVisible ? vbar.prefWidth(-1) : 0;
  double hbarHeight = hbarVisible ? hbar.prefHeight(-1) : 0;
  double w = layoutWidth - vbarWidth;
  double h = layoutHeight - hbarHeight;
  content.resize(w, h);
  hbar.setVisibleAmount(w);
  vbar.setVisibleAmount(h);
  if(vbarVisible) {
    vbar.resizeRelocate(layoutWidth - vbarWidth, 0, vbarWidth, h);
  }
  if(hbarVisible) {
    hbar.resizeRelocate(0, layoutHeight - hbarHeight, w, hbarHeight);
  }
}
origin: stackoverflow.com

 @Override
public void start(Stage primaryStage) {
  ScrollBar scrollBar = new ScrollBar();
  scrollBar.setOrientation(Orientation.VERTICAL);

  scrollBar.setMax(100);
  scrollBar.setVisibleAmount(50);
  scrollBar.valueProperty().addListener((a,b,c) -> System.out.println(c));

  StackPane root = new StackPane();
  root.getChildren().add(scrollBar);

  Scene scene = new Scene(root, 200, 500);

  // do layout
  root.applyCss();
  root.layout();

  ScrollBarMark mark1 = new ScrollBarMark();
  ScrollBarMark mark2 = new ScrollBarMark();
  mark1.attach(scrollBar);
  mark2.attach(scrollBar);
  mark1.setPosition(50);
  mark2.setPosition(75);

  primaryStage.setScene(scene);
  primaryStage.show();
}
origin: stackoverflow.com

scrollBar.setMax(TOTAL_WIDTH - canvas.getWidth());
scrollBar.setVisibleAmount(scrollBar.getMax() * canvas.getWidth() / TOTAL_WIDTH);
javafx.scene.controlScrollBarsetVisibleAmount

Popular methods of ScrollBar

  • <init>
  • valueProperty
  • getMax
  • isVisible
  • maxProperty
  • setMin
  • setOrientation
  • visibleAmountProperty
  • visibleProperty
  • getMin
  • getOrientation
  • getValue
  • getOrientation,
  • getValue,
  • getVisibleAmount,
  • minProperty,
  • resizeRelocate,
  • setMax,
  • setValue,
  • setVisible,
  • blockIncrementProperty

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JFrame (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now