14.03.2018 Views

AWT Tutorialspoint Simply Esay Learning

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>AWT</strong><br />

shape1.setFrame(110, 160, 180,80);<br />

g2.setStroke(new BasicStroke(1.0f));<br />

}<br />

}<br />

g2.draw(shape1);<br />

Font plainFont = new Font("Serif", Font.PLAIN, 24);<br />

g2.setFont(plainFont);<br />

g2.setColor(Color.DARK_GRAY);<br />

g2.drawString("TutorialsPoint", 130, 200);<br />

Compile the program using command prompt. Go to D:/ > <strong>AWT</strong> and type the<br />

following command:<br />

D:\<strong>AWT</strong>>javac com\tutorialspoint\gui\AwtGraphicsDemo.java<br />

If no error occurs that means, compilation is successful. Run the program using<br />

following command:<br />

D:\<strong>AWT</strong>>java com.tutorialspoint.gui.AwtGraphicsDemo<br />

Output<br />

323

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!