1

I'm on Ubuntu 15.04 and I have written following program:

import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class TimeTable extends Frame {

    private Frame frame;

    public TimeTable(){
        setupGUI();
    }

    private void setupGUI(){
        frame = new Frame("TimeTable");
        frame.setSize(400, 400);
        frame.addWindowListener(new WindowAdapter(){
            public void wndClose(WindowEvent wndEvent){
                System.exit(0);
            }
        });
        frame.setVisible(true);
    }

    public static void main(String[] args){
        TimeTable timetable = new TimeTable();
    }
}

It should be a little GUI (AWT) Test-Window.

I build it with:

>> javac TimeTable.java

And run it with:

>> java TimeTable

The ICON of the AWT APP is shown in my Launcher Sidebar, but the Window doesn't appears on my Desktop.

Why not?

Martin Fischer
  • 697
  • 1
  • 6
  • 27
  • Why use AWT? See [this answer](http://stackoverflow.com/questions/6255106/java-gui-listeners-without-awt/6255978#6255978) for many good reasons to abandon AWT using components in favor of Swing. – Andrew Thompson Jul 29 '15 at 12:08

1 Answers1

2

You can install Java on Ubuntu without graphics libraries (headless?).

Install the standard Java including graphics libraries and it should work. Your code works fine on Windows inside IntelliJ.

eldrior
  • 75
  • 7