java - JavaFX 2 slider labelFormatter not being used -
i have following code not label slider "foo50", etc... 1 expect setlabelformatter
call, instead seems have no effect (the slider labelled 50, 100, etc , println's dont run). there missing? not implemented in default 2.2 skin? using oracle java 7
package javafxbugtest; import javafx.application.application; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.*; import javafx.util.stringconverter; public class javafxbugtest extends application { @override public void start(final stage primarystage) { slider cp = new slider(); cp.setlabelformatter(new stringconverter<double>() { @override public string tostring(double t) { system.out.println("nope?"); return "foo" + t.tostring(); } @override public double fromstring(string string) { system.out.println("hey"); throw new unsupportedoperationexception("not supported yet."); } }); cp.setmax(300); cp.setmin(0); cp.setshowticklabels(true); cp.setshowtickmarks(true); cp.setmajortickunit(50); cp.setminortickcount(4); cp.setvalue(152); scene scene = new scene(cp); primarystage.setscene(scene); primarystage.show(); } public static void main(string[] args) { launch(args); } }
slider label formatters not working in javafx 2.x (java 7) looks bug has been fixed in java 8:
Comments
Post a Comment