[JGoodies / Java] Themes en Look And Feels live wisselen.

Pagina: 1
Acties:

  • glmona
  • Registratie: Maart 2005
  • Laatst online: 26-01 19:35
Na wat rondzoeken op internet/google en in de JAVA-API kom ik er nog steeds niet uit.

Ik ben aan de slag gegaan met JGoodies Looks and Forms. Hiermee wordt Swing een stuk mooier. Om een Look and Feel te laten werken met een bepaald theme werkt perfect, maar om deze daarna live aan te passen is een stuk moeilijker.

Het aanpassen van de Look and Feel lukt wel. Maar om daarna op de Look and Feel een nieuwe theme toe te passen gaan niet.

Iemand een tutorial, info of iets anders wat hulp kan bieden?

glmona

  • zwippie
  • Registratie: Mei 2003
  • Niet online

zwippie

Electrons at work

Uit de meegeleverde manual:
Setting a Plastic Theme
Plastic, Plastic3D and PlasticXP support color themes much like Sun's Java Look&Feel. At startup the Plastic l&fs automatically choose a default color theme that is appropriate for the current operating system. You can override this default theme via:

PlasticLookAndFeel.setMyCurrentTheme(new DesertBlue());
try {
UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
} catch (Exception e) {}

To make use of the new color theme, you must set the theme before you set the look&feel. Find color themes in package com.jgoodies.looks.plastic.theme.
Let op die laatste regel. Eerst je theme instellen en dan pas je look&feel.

How much can you compute with the "ultimate laptop" with 1 kg of mass and 1 liter of volume? Answer: not more than 10^51 operations per second on not more than 10^32 bits.


  • glmona
  • Registratie: Maart 2005
  • Laatst online: 26-01 19:35
Dat weet ik, maar als ik opnieuw een andere theme wil instellen en daarna de look and feel weer aanpas dan werkt dit niet, alleen de look and feel wisselen werkt dan.