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

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 Pages:
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 Demo
Java NotesExample - PaintDemo.java This simple paint program leaves much...); this.setTitle("Paint Demo"); this.pack(); }//end constructor...; //--- Private constant for size of paint area. private static final int SIZE = 600
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
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 programming - Swing AWT
java programming  Develop a simple paint like program that can draw basic graphical primitives in different dimensions and colors. use appropriate menus and buttons
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
Need Help with Java-SWING progrmming - Swing AWT
Need Help with Java-SWING progrmming  Hi sir, I am a beginner in java-swing programming. I want to know how we can use the print option with a program in swing. Could you help me with an example? Regards Sreejith 
java-swings - Swing AWT
); } public void paint(Graphics g) { g.setColor(Color.red); g.fillRect(xaxis...://www.roseindia.net/java/example/java/swing/ Thanks. Amardeep
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
java - Swing AWT
for upload image in JAVA SWING....  Hi Friend, Try the following code...); } catch(Exception ex){} repaint(); } } }); } public void paint(Graphics
java - Swing AWT
void paint(Graphics g) { g.drawImage( image, 0, 0, null); } static
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
Java - Swing AWT
Dimension(w, h); } public void paint(Graphics g) { filterImage
Java Code - Swing AWT
); } public void paint(Graphics g) { filterImage(); g.drawImage
java - Swing AWT
(); } public void paint(Graphics g) { g.drawImage( image, 0, 0, null
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
c c++ - Swing AWT
(DELAY, this); timer.start(); }  continue.... public void paint
about java swing - Java Beginners
about java swing   How to upload the pictures and photo on the panel in java swing ,plz help thank a lot.  Hi Friend, Try...() { return new Dimension(w, h); } public void paint(Graphics g
Java Swing Tutorials
Java Swing Tutorials       Java Swing tutorials -  Here you will find many Java Swing... and you can use it in your program. Java Swing tutorials first gives you brief
What is Java Swing?
What is Java Swing?       Here, you will know about the Java swing. The Java Swing provides... and GUIs components. All Java Swing classes imports form the import
Simple Font Paint Example
Simple Font Paint Example       This section illustrates you how to paint the font... paint(Graphics g) {         Graphics2D g2d = (Graphics2D)g;         String st
Simple Gradient Paint Example
Simple Gradient Paint Example       This section illustrates you how to use Gradient Paint.... To use a Gradient paint, we have used the class Elipse2D which provides the shape
Another Example of Gradient Paint
Another Example of Gradient Paint       This section shows you the gradient Paint on rounded corner... the two points. To use a Gradient paint, you must have a shape object and two end
java image loadin and saving problem - Swing AWT
; public void paint(Graphics g) { g.drawImage( image, 0, 0, null); } public...() { return new Dimension(w, h); } public void paint(Graphics g
Error in laodin and saving the image . - Swing AWT
file=null; Image img; public void paint(Graphics g) { g.drawImage( image, 0, 0
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
Round gradient Paint Example
Round gradient Paint Example       This section illustrates you how to create round or radial...;RoundGradientPaintExample extends JPanel{  public void paint
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
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
Print Screen Using Java Swing
Print Screen Using Java Swing   ... swing. The printable that is passed to setPrintable must have a print method... the component's paint method with this scaled Graphics2D. Here is the code of this program
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
Jva swing
Jva swing   How to create the model form like "Notepad
AWT & SWING
AWT & SWING  What is diffennce between AWT & SWING
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
java swing
java swing  view the book details using swing