+ 5

Can someone halp me? (JAVA)

When i write this code in eclipse it work perfectly, but when i tried to write it in sololearner it doesn't. Can someone halp me, and tell me where is a mistake? This is code(it's java): import javafx.application.Application; import javafx.event.ActionEvent; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import javafx.stage.Stage; public class MathFX extends Application { TextField txtnum1, txtnum2; Button btnadd, btnsub, btndiv, btnmul, btnclear; Label lblanswer; @Override public void start(Stage primaryStage) { //pravim kontrole txtnum1=new TextField(); txtnum2=new TextField(); btnadd=new Button("+"); btnsub=new Button("-"); btnmul=new Button("x"); btndiv=new Button("/"); btnclear=new Button("Clear"); lblanswer=new Label("?"); //center text in label lblanswer.setAlignment(Pos.CENTER); //apply ccs-like style to label (yes, you can) lblanswer.setStyle("-fx-border-color: #000; -fx-padding: 5px;"); //make container for app GridPane root = new GridPane(); //put container in middle of scene root.setAlignment(Pos.CENTER); //setspacing between controls in grid root.setHgap(10); root.setVgap(10); //add to grid, cell by cell root.add(btnadd,0,0); root.add(btnsub,1,0); root.add(btnmul,0,1); root.add(btndiv,1,1); root.add(txtnum1, 0,2); root.add(txtnum2,1,2); //last 2 rows span across 2 columns //col, rol, colspan, rowspan root.add(lblanswer,0,3,2,1); root.add(btnclear,0,4,2,1); //set widths of all controls in separate m

25th Aug 2017, 12:04 PM
Milica Smiljanic
Milica Smiljanic - avatar
12 Respuestas
+ 1
Jel se profesionalno bavis programiranjem?
16th Oct 2017, 10:38 AM
Isailovic Milan
Isailovic Milan - avatar
+ 12
JavaFX is not supported at the playground, nor is any other gui framework.
25th Aug 2017, 3:17 PM
Tashi N
Tashi N - avatar
+ 6
When you say (work in others, not in sololearn), I can easily say, The Sololearn Code Playground sucks. To run complex code you shouldn't use Code Playground
25th Aug 2017, 12:13 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 5
some codes are not supported by sololearn playground
25th Aug 2017, 12:14 PM
Changed
Changed - avatar
+ 2
Studiram programiranje na matematickom fakultetu, a nadam se da cu se kasnije baviti profesionalno
16th Oct 2017, 1:51 PM
Milica Smiljanic
Milica Smiljanic - avatar
+ 2
I am studing programing on University of Belgrade, and i hope i will be professional after that
16th Oct 2017, 1:52 PM
Milica Smiljanic
Milica Smiljanic - avatar
+ 1
Are you professional?
30th Sep 2017, 12:09 PM
Nitesh Solanki
Nitesh Solanki - avatar
+ 1
Ja krenuo pre neki dan na ITakademiju, jel mogu ovde da se pisu PM?
16th Oct 2017, 1:54 PM
Isailovic Milan
Isailovic Milan - avatar
+ 1
Private mesagge
16th Oct 2017, 2:03 PM
Isailovic Milan
Isailovic Milan - avatar
+ 1
Gde bih mogao da ti pisem, ako mi zatreba neka pomoc? Naravno ako moze tako
16th Oct 2017, 3:28 PM
Isailovic Milan
Isailovic Milan - avatar
+ 1
Instagram?
16th Oct 2017, 3:30 PM
Isailovic Milan
Isailovic Milan - avatar
+ 1
Isto
16th Oct 2017, 3:32 PM
Milica Smiljanic
Milica Smiljanic - avatar