Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to draw in class from uot side it ??? Posted by NCS_One on 13 Mar 2005 at 10:58 PM
Hi

Im trying to create :

class MySomething extends Component {

public MySomething() {}

public void paint(Graphics g) {
g.drawString("MySomething",10,10);
}
}

but when i call it from a applet it doesnt draw in the applet.

Thanks for all the help
Report
Re: How to draw in class from uot side it ??? Posted by NCS_One on 14 Mar 2005 at 7:02 PM
Sorry my mistake.
With the paint() i can do it but how do i do it
without the paint() ???
Report
Re: How to draw in class from uot side it ??? Posted by moo on 15 Mar 2005 at 8:13 AM
: Sorry my mistake.
: With the paint() i can do it but how do i do it
: without the paint() ???
:
don't know, did not try it, but how about Component.getGraphics().drawString(...)
greetings
mo
Report
Re: How to draw in class from uot side it ??? Posted by NCS_One on 15 Mar 2005 at 8:40 AM
: don't know, did not try it, but how about Component.getGraphics().drawString(...)
: greetings
: mo
:

Hi

I tryed that and it throws a nullpointerexception.
Report
Re: How to draw in class from uot side it ??? Posted by dogtag1 on 15 Mar 2005 at 4:23 PM
: Hi
:
: Im trying to create :
: import javax.swing.JApplet
: class MySomething extends JApplet {
:
: public MySomething() {}
:
: public void paint(Graphics g) {
: g.drawString("MySomething",10,10);
: }
: }
:
you can try that.
Report
Re: How to draw in class from uot side it ??? Posted by NCS_One on 15 Mar 2005 at 7:43 PM
Hi

Yes like that it works,drawing from a class
japplet, but how can i from a
class component draw in a class Applet ???

Thanks



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.