Guest User

Untitled

a guest
Jan 27th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1.  
  2. import javafx.application.Application;
  3. import javafx.scene.Group;
  4. import javafx.scene.Scene;
  5. import javafx.scene.control.Button;
  6. import javafx.scene.control.ScrollPane;
  7. import javafx.scene.image.Image;
  8. import javafx.scene.image.ImageView;
  9. import javafx.scene.layout.HBox;
  10. import javafx.stage.Stage;
  11.  
  12. public class ScrollPaneTest extends Application {
  13.  
  14.     public static void main(String[] args) {
  15.         launch(args);
  16.     }
  17.  
  18.     @Override
  19.     public void start(Stage stage) {
  20.  
  21.         Button button = new Button();
  22.         button.setGraphic(new ImageView(new Image("folders.png")));
  23.         Button button2 = new Button();
  24.         button2.setGraphic(new ImageView(new Image("folders.png")));
  25.  
  26.         HBox hbox = new HBox(button, button2);
  27.         ScrollPane scrollPane = new ScrollPane(new Group(hbox));
  28.         Scene scene = new Scene(scrollPane);
  29.         stage.setScene(scene);
  30.         stage.show();
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment