Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2008, 05:53 AM
Member
 
Join Date: Oct 2008
Posts: 30
Rep Power: 0
Urgle is on a distinguished road
Default Images in AWT frame
how can I put an image in an AWT frame that is run outside of an applet?

Heres the code for my frame:
Code:
Frame f=new Frame("Music Info:");
      f.setBackground(Color.yellow);
      f.setVisible( true );  
      TextArea textArea=new TextArea("Come Clarity by In Flames",2,30);
      textArea.setEditable(False);
      f.add(textArea);
      f.setLayout(new FlowLayout());
      f.setSize(250,250);
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-02-2008, 05:58 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,451
Rep Power: 8
Fubarable is on a distinguished road
Default
Just curious, why AWT and not Swing? One reason for the question: I know Swing but really don't know AWT, and from what I know, most don't use it as much.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-02-2008, 06:32 AM
Member
 
Join Date: Oct 2008
Posts: 30
Rep Power: 0
Urgle is on a distinguished road
Default
im using AWT because I am being taught in that form. I have no idea how to use swing and I dont have the time to relearn java.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-02-2008, 07:29 AM
Darryl.Burke's Avatar
Senior Member
 
Join Date: Sep 2008
Location: Madgaon, Goa, India
Posts: 732
Rep Power: 2
Darryl.Burke is on a distinguished road
Default
From your question
> how can I put an image in an AWT frame that is run outside of an applet?
I'll have to guess that you do know how to put an image in an Applet.

For a standalone AWT application, you would use a Canvas and override paint(Graphics g) in exactly the same way as for an Applet. Then add the Canvas to the Frame, using an appropriate Layout Manager.

And if you're spending money to be taught AWT and not Swing, you're being ripped off. AWT is legacy. Swing has been around long enough that it should be used for all new applications.

db
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 12-02-2008, 07:37 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by Urgle View Post
im using AWT because I am being taught in that form. I have no idea how to use swing and I dont have the time to relearn java.
Not a huge thing to learn Swing lol. Just read about Swing on the Suns' official web site. Java Swing
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting internal frame out rad New To Java 8 08-11-2008 03:33 AM
Frame to other Frame Aswq New To Java 2 07-19-2008 05:27 PM
close a frame.. tajinvillage New To Java 5 04-27-2008 11:22 PM
Frame Query Daniel AWT / Swing 1 07-05-2007 07:27 PM
Frame problems gary AWT / Swing 2 06-20-2007 02:21 PM


All times are GMT +2. The time now is 02:55 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org