-
Bug
-
Resolution: Fixed
-
P4
-
fx2.0
-
java6
windows 7
fx b41
To reproduce run following code
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.BoundingBox;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollPane;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class ScrollPaneSample extends Application {
public static void main(String[] args) {
launch( args);
}
private Parent getContent() {
Pane box = new Pane();
final ScrollPane pane = new ScrollPane();
HBox hbox = new HBox(20);
VBox vbox1 = new VBox(10);
vbox1.getChildren().addAll(new Label("one"), new Button("two"), new CheckBox("three"), new RadioButton("four"), new Label("five"));
VBox vbox2 = new VBox(10);
vbox2.getChildren().addAll(new Label("one"), new Button("two"), new CheckBox("three"), new RadioButton("four"), new Label("five"));
hbox.getChildren().addAll(vbox1, vbox2);
pane.setContent(hbox);
pane.setStyle("-fx-background-color: red;-fx-border-color:green;-fx-border-width:5;");
pane.setFocusTraversable(false);
pane.setOnMouseDragged(new EventHandler<MouseEvent>(){
@Override
public void handle(MouseEvent t) {
pane.setPrefSize(t.getSceneX(),t.getSceneY());
}
});
box.getChildren().add(pane);
return box;
}
public void start(Stage stage) {
stage.setX(100);
stage.setY(100);
stage.setWidth(300);
stage.setHeight(300);
Scene scene = new Scene(getContent());
stage.setScene(scene);
stage.show();
}
}
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.BoundingBox;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollPane;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class ScrollPaneSample extends Application {
public static void main(String[] args) {
launch( args);
}
private Parent getContent() {
Pane box = new Pane();
final ScrollPane pane = new ScrollPane();
HBox hbox = new HBox(20);
VBox vbox1 = new VBox(10);
vbox1.getChildren().addAll(new Label("one"), new Button("two"), new CheckBox("three"), new RadioButton("four"), new Label("five"));
VBox vbox2 = new VBox(10);
vbox2.getChildren().addAll(new Label("one"), new Button("two"), new CheckBox("three"), new RadioButton("four"), new Label("five"));
hbox.getChildren().addAll(vbox1, vbox2);
pane.setContent(hbox);
pane.setStyle("-fx-background-color: red;-fx-border-color:green;-fx-border-width:5;");
pane.setFocusTraversable(false);
pane.setOnMouseDragged(new EventHandler<MouseEvent>(){
@Override
public void handle(MouseEvent t) {
pane.setPrefSize(t.getSceneX(),t.getSceneY());
}
});
box.getChildren().add(pane);
return box;
}
public void start(Stage stage) {
stage.setX(100);
stage.setY(100);
stage.setWidth(300);
stage.setHeight(300);
Scene scene = new Scene(getContent());
stage.setScene(scene);
stage.show();
}
}