Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2004

Tip: Looking for answers? Try searching our database.

InternalWindow Icon

Thread view: 
Bj?rn Csott - 16 Jul 2004 11:00 GMT
Hallo,
diese Frage wurde schon hundertmal gestellt aber noch nie so
beantwortet wie ichs bräuchte.
Und zwar

Wie ändere ich das Icon bei einem InternalWindow?

Ja, ich weis das geht über die Methode
InternalWindow.setFrameIcon(Icon icon)!

Aber was um Himmelswillen ist Icon? Ein Interface soviel hab ich auch
heraus bekommen?
Aber was bringt es mir diese Interface zu implementieren? Ich versteh
das einfach nicht? Wie mach ich aus meinem gif oder besser meinem
Icon.ico eine Objekt vom Typ Icon????
Muss ich aus der Datei irgendwie eine Instanz vom Typ Component machen
und diese dann mit der Methode Icon.paintIcon(Component, Graphics,
int, int) zeichnen kann? Kann ich mir nicht vorstellen.

Vielen Dank im Voraus
Björn Csott
Ralf Rapude - 16 Jul 2004 11:21 GMT
Moin,
 ImageIcon icon = new ImageIcon(
    MeineKlasse.class.getResource("pics/log_icon.gif"));
 setIconImage(icon.getImage());

Signature

greetz Ralf Rapude
für reply Ralf. weglassen

Sascha Broich - 16 Jul 2004 11:25 GMT
Bj?rn Csott schrieb:

> Hallo,
> diese Frage wurde schon hundertmal gestellt aber noch nie so
[quoted text clipped - 8 lines]
> Aber was um Himmelswillen ist Icon? Ein Interface soviel hab ich auch
> heraus bekommen?

Was willst du mehr?

> Aber was bringt es mir diese Interface zu implementieren? Ich versteh
> das einfach nicht? Wie mach ich aus meinem gif oder besser meinem
> Icon.ico eine Objekt vom Typ Icon????

Du mußt nicht selbst implementieren, es gibt schon etwas für deinen Fall:
ImageIcon

Lade mittels ImageIO oder Toolkit dein gif, packe es in ein ImageIcon und
schon kannst du es als Icon verwenden.

.ico Dateien kannst du nicht so einfach laden. Schau dir dafür mal
<http://www.acproductions.de/commercial/aclibico/index.html> an.

Sascha Broich
Signature

Ob eine schwarze Katze Unglück bringt, hängt davon ab,
ob man ein Mensch ist oder eine Maus.

Christophe Vanfleteren - 16 Jul 2004 18:01 GMT
> Hallo,
> diese Frage wurde schon hundertmal gestellt aber noch nie so
[quoted text clipped - 17 lines]
> Vielen Dank im Voraus
> Björn Csott

If you look at the Javadocs, you can see all the classes that implement
Icon:
<http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/Icon.html>

As others have said, ImageIcon is probably the class you need.

Kind regards,
Christophe Vanfleteren


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.