Hallo zusammen
Kann ich irgendwo Einstellen, dass er immer ein definiertes Look and Feel braucht ?
Ich suche also ein Konfigureationsfile fuer Java
Hallo zusammen
Kann ich irgendwo Einstellen, dass er immer ein definiertes Look and Feel braucht ?
Ich suche also ein Konfigureationsfile fuer Java
hi,
ich bin mir nicht so ganz sicher ob ich deine frage richtig verstehe.
die java vm properties sind ueber System.getProperties() zu erfragen,
eigene configs kannst du ueber die Properties Klasse erstellen.
gruss,
tuxipuxi.
danke, aber ich habe eher gemeint, dass man das direkt in einem File definieren kann.
Und nicht in einem Programm.
Ich moechte einfach das der Standard Look and Feel ein anderer ist
gruss akula
Anstatt das Metal ein Motiv oder ein Windows?
MfG BischiCode:try { String plaf = ""; if (WelchesLAF == 1) { plaf = "javax.swing.plaf.metal.MetalLookAndFeel";//javax.swing.plaf.metal.MetalLookAndFeel } else if (WelchesLAF == 2) { plaf = "com.sun.java.swing.plaf.motif.MotifLookAndFeel"; } else if (WelchesLAF == 3) { plaf = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; } UIManager.setLookAndFeel(plaf); SwingUtilities.updateComponentTreeUI(this); button1.updateUI(); .... } catch (UnsupportedLookAndFeelException e) { System.err.println(e.toString()); } catch (ClassNotFoundException e) { System.err.println(e.toString()); } catch (InstantiationException e) { System.err.println(e.toString()); } catch (IllegalAccessException e) { System.err.println(e.toString()); }
"There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss it" The hitchhiker's guide to the galaxy by Douglas Adams
--> l2picfaq.pdf <-- www.n.ethz.ch/~dominikb/index.html LaTeX-Tutorial, LaTeX-Links, Java-Links,...
zumindest das GTK lf das ich mal hatte war immer Default...
aber wie das eingestellt wird weiss ich nicht
MfG Peschmä
The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)
also du meinst schon für _alle_ Swing - progs, oder?
MfG Peschmä
The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)
@peschmae: Soviel zum Thema Spammen
Meine Variante funktioniert immer da, wo du im Programm wechseln willst (und natürlich nur für Swing).
MfG Bischi
"There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss it" The hitchhiker's guide to the galaxy by Douglas Adams
--> l2picfaq.pdf <-- www.n.ethz.ch/~dominikb/index.html LaTeX-Tutorial, LaTeX-Links, Java-Links,...
das war ein Wink mit dem Riesenzaunpfahl...Original geschrieben von akula
danke, aber ich habe eher gemeint, dass man das direkt in einem File definieren kann.
Und nicht in einem Programm.
Ich moechte einfach das der Standard Look and Feel ein anderer ist
aber ist dir wohl entgangen, was?
das Zitat stammt von _vor_ deinem Beitrag
MfG Peschmä
The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)
so, jetzt noch die Antwort (ist ein neuen Beitrag wert, ich bin dafür Spam vom Rest zu trennen )
http://java.sun.com/docs/books/tutor...ml#commandLine
allerdings nützt das nix, wenn ne App (wie die nach Bischi-Vorschlag gebastelten ) das nachträglich ändert, dann kannst du gaaaaar nix machenSpecifying the Look and Feel: Command Line
You can specify the look and feel at the command line by using the -D flag to set the swing.defaultlaf property. For example:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKL ookAndFeel MyApp
java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows. WindowsLookAndFeel MyApp
Specifying the Look and Feel: swing.properties
Yet another way to specify the current look and feel is to use the swing.properties file to set the swing.defaultlaf property. This file is located in the lib directory of the Java release. For example, if you're using the Java interpreter in javaHomeDirectory\bin, then the swing.properties file (if it exists) is in javaHomeDirectory\lib. Here is an example of the contents of a swing.properties file:
# Swing properties
swing.defaultlaf=com.sun.java.swing.plaf.windows.W indowsLookAndFeel
(ausser die App hat ne Option zum Umstellen)
MfG Peschmä
The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)
Lesezeichen