Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
Click to see the videos
Click to see the video
Click to see the video
view layout [
text "Hello world!"
button "Quit" [quit]
]
Click to see the video
import java.awt.*;
import java.awt.event.*;
public class HelloWorld extends Frame {
private static final long serialVersionUID = -1113582265865921787L;
public static void main (String [] argv){
HelloWorld h = new HelloWorld();
}
public HelloWorld(){
setTitle("Hello World!");
setSize(300, 250);
Panel hello = new Panel();
add("Center", hello);
Button button = new Button("OK");
add("South", button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
setVisible(true);
int width = hello.getWidth();
int height = hello.getHeight();
Graphics g = hello.getGraphics();
g.drawString("Hello World!", width/2 - 25, height/2);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}