Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


santosh
Swing paint
1 Answer(s)      5 years and 4 months ago
Posted in : Swing AWT



Advertisement
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


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
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  A JAVA CODE OF MOVING TRAIN IN SWING
swing
swing  How to make swing component auto-resizable when JFrame resize
swing
swing  Write a java swing program to delete a selected record from a table
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
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
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  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
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 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 Program
Swing Program  Write a java swing program to calculate the age from given date of birth
swing sms
swing sms  HOW TO SEND SMS MESSAGE FROM SWING USING SQL DATABASE
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 - 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   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 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
Jva swing
Jva swing   How to create the model form like "Notepad
printing in swing
printing in swing  How can i print payslip in swing
java swing
java swing  view the book details using swing
AWT & SWING
AWT & SWING  What is diffennce between AWT & SWING
Java swing
Java swing  Does Swing contains any heavy weight component
Java swing
Java swing  what are the root classes of all classes in swing
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 question - Swing AWT
Swing question  I want to move a string in JFrame similarily as done by marquee tag in HTML.The string should move from right to left. How can I do this?  Hi Friend, Try the following code: import java.awt.
SWING - Swing AWT
SWING  how to insert image and components such as JLabel,JButton,JTextfield in JFrame in swing?  Hi Friend, Try the following code: import java.io.*; import java.awt.*; import javax.swing.*; import
 

 

 

DMCA.com