| | |
display the System.out.print msgs
![]() |
•
•
Join Date: Apr 2008
Posts: 18
Reputation:
Solved Threads: 1
The following code is used for creating java frame.
import java.awt.*;
import java.awt.event.*;
class test extends Frame implements WindowListener{
test(){
setTitle("Java Frame");
setSize(400,250);
addWindowListener(this);
setVisible(true);
}
public void windowOpened(WindowEvent e){}
public void windowClosing(WindowEvent e){
System.exit(0);
}
public void windowClosed(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
public void windowActivated(WindowEvent e){}
public void windowDeactivated(WindowEvent e){}
public static void main(String ars[]){
test t = new test();
}
}
------------------------------------------------------------------
this code is used to print the string in the frame
Graphics g;
g.drawString(variable_name,x,y);
variable_name -> print string
x -> x axis in the frame
y -> y axis in the frame
this code is used to print the string in the frame
import java.awt.*;
import java.awt.event.*;
class test extends Frame implements WindowListener{
test(){
setTitle("Java Frame");
setSize(400,250);
addWindowListener(this);
setVisible(true);
}
public void windowOpened(WindowEvent e){}
public void windowClosing(WindowEvent e){
System.exit(0);
}
public void windowClosed(WindowEvent e){}
public void windowIconified(WindowEvent e){}
public void windowDeiconified(WindowEvent e){}
public void windowActivated(WindowEvent e){}
public void windowDeactivated(WindowEvent e){}
public static void main(String ars[]){
test t = new test();
}
}
------------------------------------------------------------------
this code is used to print the string in the frame
Graphics g;
g.drawString(variable_name,x,y);
variable_name -> print string
x -> x axis in the frame
y -> y axis in the frame
this code is used to print the string in the frame
![]() |
Other Threads in the Java Forum
- Previous Thread: Help With an error
- Next Thread: binding properties
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows





