-
Bug
-
Resolution: Fixed
-
P2
-
7u6
-
Linux Ubuntu 12.04x86, JDK7, JavaFX 2.2.0b08.
Run this code:
package menubutton;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.MenuButton;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class MenuButtonApp extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
MenuButton mb = new MenuButton();
mb.getItems().addAll(new MenuItem("Item 1"), new MenuItem("Item 12"), new MenuItem("Item 3"));
vb.getChildren().add(mb);
mb.setText("SomeText");
mb.setTranslateX(100);mb.setTranslateY(100);
Scene scene = new Scene(vb, 300, 300);
stage.setScene(scene);
stage.show();
}
}
package menubutton;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.MenuButton;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class MenuButtonApp extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
MenuButton mb = new MenuButton();
mb.getItems().addAll(new MenuItem("Item 1"), new MenuItem("Item 12"), new MenuItem("Item 3"));
vb.getChildren().add(mb);
mb.setText("SomeText");
mb.setTranslateX(100);mb.setTranslateY(100);
Scene scene = new Scene(vb, 300, 300);
stage.setScene(scene);
stage.show();
}
}
- duplicates
-
JDK-8120889 text and menuitems are split from the MenuButton after setting translateX and translateY.
- Closed