Swing paint

Ads

 
 

Share on Google+Share on Google+

santosh
Swing paint
1 Answer(s)      8 years ago
Posted in : Swing AWT
Ads
View Answers

August 22, 2009 at 11:54 AM


Hi Friend,

1) Create SwingApplet.java

import java.awt.*;
import javax.swing.*;

public class SwingApplet extends JApplet
{
String str="Hello World";
public void paint(Graphics g){
super.paint( g );
g.drawString(str,100,200);
}
}

2) To call the Swing Applet, use html file with the following code:

<html>
<body>
<h1>Java Applet Demo</h1>
<applet code=SwingApplet.class width=500 height=350>
</applet>
</body>
</html>

Thanks

Ads









Related Tutorials/Questions & Answers:
Swing paint - Swing AWT
Swing paint  hi, i want to print something on window using swing...) { super.paintComponent(g); g.drawString(str,100,200); } but m nt able to paint dis... extends JApplet { String str="Hello World"; public void paint(Graphics g
Paint an Image
Paint an Image       This section provides you to paint an image on the frame. Paint means draw... to paint an image on the fame to specified location. For this you need images
Advertisements
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
swing
swing  Write a java swing program to delete a selected record from a table
swing
swing  How to make swing component auto-resizable when JFrame resize
Show Textured Paint
Show Textured Paint       This section shows you the textured paint. Texture refers to the roughness of the smoothness of a work of art. The way in which you paint involves
Another Example of Gradient Paint
Another Example of Gradient Paint       This section shows you the gradient Paint on rounded... the two points. To use a Gradient paint, you must have a shape and two end points
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Swing
Swing  Write a java swing program to search the details of the students. Searching is performed on studentā??s first name. The details of all those students having same name as in given in searching criterion will be displayed
Java - Swing AWT
or paint from my swing program?  Hi friend, import java.awt....("Paint example frame") ; getContentPane().add(new JPaintPanel...) ; } public static void main(String[] args){ System.out.println("This is simple paint
java swing - Swing AWT
java swing  how i can insert multiple cive me exampleolumn and row in one JList in swing?plz g  Hi Friend, Please clarify your question. Thanks
swing-awt - Swing AWT
swing-awt  Hi, Thanks for replying to my question...I'm getting some confusion to add action events in my application(Rich Text Editor).How to add action events? Thank U
What is Swing?
What is Swing?  What is Java Swing? Where to get the tutorials of Swing? I am beginner in Java Swing programming and trying to find the tutorials of Swing. Tell me the urls to learn swing. Thanks   Hi, Swing is Java
swing/awt - Swing AWT
swing/awt  How to create richtexteditor using swings...?I'm very much new to swings....It's urgent.....Thank u...   hello read this book you get idea; JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second
swing sms
swing sms  HOW TO SEND SMS MESSAGE FROM SWING USING SQL DATABASE
Swing Program
Swing Program  Write a java swing program to calculate the age from given date of birth
SWING FRMES
SWING FRMES  hai SIR? HOW TO DESIGN swing Frames send source code
SWING FRMES
SWING FRMES  hai SIR? HOW TO DESIGN swing Frames send source code
swing to applet
swing to applet  hi how i can isplay a java swing into applet java thanks
java swing - Swing AWT
java swing   how i can insert in JFrame in swing?  Hi Friend, Try the following code: import java.awt.*; import javax.swing.*; import java.awt.event.*; class FormDemo extends JFrame { JButton ADD; JPanel
java swing - Swing AWT
java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image....: http://www.roseindia.net/java/example/java/swing/ Thanks
Java swing
Java swing  what are the root classes of all classes in swing
Java swing
Java swing  Does Swing contains any heavy weight component
AWT & SWING
AWT & SWING  What is diffennce between AWT & SWING
java swing
java swing  view the book details using swing
printing in swing
printing in swing  How can i print payslip in swing
Jva swing
Jva swing   How to create the model form like "Notepad
swing program
swing program  Write a java swing program to getname and email id. Display the message if email id contains the name of theuser
SWING - Swing AWT
SWING  how can i insert image in Jpanel by extending class with JFrame in swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image.*; import java.io.*; import javax.imageio.*; import
java swing - Swing AWT
java swing   Iam developing a java web browser.Actually my code works fine ie. i can load a web page without proxy.But in my place i have only proxy servers through which i should visit any web site.So, i want my browser also
swing - Swing AWT
swing   how to create JTabbedPane.when i choose one jtabbedpane it will appear JTextField,resultMessages.pls give me any examples  Hi Friend, Try the following code: import javax.swing.*; import java.awt.

Ads

 
Advertisement null

Ads