java - How to display text vertically on a button in JavaFX? -


i want create button , display it's text vertically on it, in javafx. aware of rotate not want use it.is there other way name button vertically.enter image description here

rotate way this, there no other solution.

rotated

sample code:

import javafx.application.application; import javafx.geometry.pos; import javafx.scene.*; import javafx.scene.control.*; import javafx.scene.layout.stackpane; import javafx.stage.stage;  /* displays button it's text rotated 90 degrees left */ public class rotatedtext extends application {     @override public void start(stage stage) {         button feedbackbutton = createbuttonwithrotatedtext("feedback form");          stackpane layout = new stackpane();         layout.getchildren().setall(feedbackbutton);         stackpane.setalignment(feedbackbutton, pos.top_right);         layout.setprefsize(225, 275);         layout.setstyle("-fx-background-color: lightcyan;");          stage.setscene(new scene(layout));         stage.show();     }      private button createbuttonwithrotatedtext(string text) {         button button = new button();         label  label  = new label(text);         label.setrotate(-90);         button.setgraphic(new group(label));          // in-line css used sample purposes,         // apply stylesheet.         button.setstyle(                 "-fx-base: orange; " +                 "-fx-font-size: 30px; " +                 "-fx-text-background-color: whitesmoke;"         );          return button;     }      public static void main(string[] args) { launch(args); } } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -