Results 1 to 5 of 5
- 11-11-2010, 03:24 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 3
- Rep Power
- 0
- 11-11-2010, 03:27 PM #2
Senior Member
- Join Date
- Feb 2009
- Posts
- 303
- Rep Power
- 5
Is there a Question attached? Have you attempted to make one?
-
Agree. A little demonstration of effort and an actual question will go a long way to motivating many to help.
- 11-12-2010, 01:20 AM #4
Member
- Join Date
- Nov 2010
- Posts
- 3
- Rep Power
- 0
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
class MyFrame1 extends Frame
{
MyFrame1()
{
setTitle("this is the Frame....");
setBackground(Color.GREEN);
setSize(200,200);
setVisible(true);
setFont(new Font("Dialog",Font.BOLD,10));
MyMouseAdapter adapter=new MyMouseAdapter(this);
addMouseListener(adapter);
//addWindowListener(new MyWindowAdapter(this));
}
public void paint(Graphics g)
{
g.drawString("Click HERE",30,60);
}
}
class MouseClick
{
public static void main(String args[])
{
MyFrame1 mf=new MyFrame1();
}
}
class MyMouseAdapter extends MouseAdapter
{
MyFrame1 mf1;
int x=200;int y=200,a=10;
MyMouseAdapter(MyFrame1 mf1)
{
this.mf1=mf1;
}
public void mousePressed(MouseEvent me)
{
x+=20;
y+=20;a+=1;
mf1.setSize(x,y);
if(x==500)
{
x=100;
a=10;
}
if(y==500)
{
y=100;
a=10;
}
Font f=new Font("Dialog",Font.BOLD,a);
mf1.setFont(f);
}
}
//I CAN'T ABLE TO EXIT SYSTEM IN THIS PROGRAM.PLESE HELP
- 11-12-2010, 04:25 AM #5
Senior Member
- Join Date
- Feb 2009
- Posts
- 303
- Rep Power
- 5
Similar Threads
-
Trying to calculate cost based on size
By space4rent00 in forum New To JavaReplies: 4Last Post: 03-22-2010, 07:13 AM -
Frame size clipping pixels off right side with Absolute Positioning
By Psyclone in forum New To JavaReplies: 2Last Post: 02-08-2010, 12:03 AM -
Setting frame size to the size of an image
By Yoruichi in forum AWT / SwingReplies: 5Last Post: 04-22-2009, 04:37 PM -
Prob. with screen resolution and Frame size??
By SANDY_INDIA in forum AWT / SwingReplies: 1Last Post: 08-16-2008, 12:51 PM -
[SOLVED] How to set the frame size?
By impact in forum New To JavaReplies: 7Last Post: 05-02-2008, 11:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks