Java isn't working, why?
Stanlyhalo (20)

I have made a window program before in another program, but it won't work, I hit run, and nothing happens, why? Repl:

(Also opening it in another window is just a terminal).


Got it to work better, but if you check it out now, as you can see I am getting an error, saying something about line 11 on

You are viewing a single comment. View All
Zeune (34)

For Swing they implemented Java Swing as a language; it is separate from standard Java. Here you can program in a windowed environment.

Stanlyhalo (20)

@Zeune So it's already a window?

Zeune (34)

@Stanlyhalo So a few issues with the code, and once you get it setup you will run into an X11 Display error. Currently in your project you do not have a class called and you are trying to reference your constructor called inside of Main. That needs to be changed. Then, you will come into other errors for using the this reference object when there is nothing to.

Also, to answer your question about it is already a window. It's a window that is above the console it's built into the environment so you won't be able to click and drag it around. Resizing seems to be hit and miss as well. Honestly, I set my project up but, without being able to say obj.add(comp) I am struggling figuring out the project setup for Java Swing on