0
The exit button is functional but I can't put it below the calculate button
4 Answers
+ 1
Here in SoloLearn, you can write programs just for console(I mean Java language)
0
This is console.. Can't use GUI there
0
Ouhh so how can i fix itâčïž should i copy paste the code here?
0
I'm from phone, I can't check out your code..
button instance and btn looks different
JButton btn = new JButton("CALCULATE");//creating instance of JButton
btn.setBounds(120, 150, 150, 40);//x axis, y axis, width, height
JButton button = new JButton("Click to Close!");
but didnt set bounds for button..
button.setBounds(...);
--snip--
f.add(btn);//adding button in JFrame
add btn but didnt add button..
f.add(button);
You need look at documentation for swing library https://docs.oracle.com/javase/tutorial/uiswing/index.html