[Resuelto / Solved] Look And Feel (LAF)

Buenos días, tardes o noches muchachos! Explico un poco el tema: resulta que estoy usando un LAF (Look And Feel), de manera más específica  Synthetica BlueLight Look and Feel http://www.javasoft.de/synthetica/themes/
pero cuando ejecuto por primera vez el código (prueba) me sale la típica ventana de Java y no se aplica por completo el estilo o tema que apliqué, por otro lado al aplicar un "dispose();" y ejecutar nuevamente el código se logra visualizar bien.
Entonces las preguntas son ¿Esto es por defecto? ¿Hay alguna solución? ¿Que me recomiendan hacer? , les dejo el código y una imagen por si lo necesitan.
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import Utilerias.Apariencia;
import componentes.CompMenu;
import componentes.CompMenuItem;
public class pruebaMenu extends JFrame implements ActionListener
   private JMenuBar     menuBarra;
   private CompMenu     menu;
   private CompMenuItem item;
   public pruebaMenu()
                             new Apariencia(Apariencia.SYNTHETICA_BLUE_LIGHT);
      menuBarra = new JMenuBar();
      setJMenuBar(menuBarra);
      menu = new CompMenu(menuBarra,"Menu_1");
      item = new CompMenuItem(menu,"Reynald0",this);
      this.setVisible(true);
      this.setBounds(200,200,400,300);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
   public void actionPerformed(ActionEvent pE)
      if(pE.getSource().equals(item))
         System.out.println("El menu2");
         dispose();
         new pruebaMenu();
   public static void main(String[] args)
      new pruebaMenu();
De antemano MUCHAS gracias por su ayuda y tiempo! Un cordial saludo!

La solución es colocar
new Apariencia(Apariencia.SYNTHETICA_BLUE_LIGHT); 
Antes de mandar a llamar el JFrame para que se apliquen los cambios, debe quedar así:
public static void main(String[] args) 
      new Apariencia(Apariencia.SYNTHETICA_BLUE_LIGHT);
      new pruebaMenu(); 

Similar Messages

  • Is it possible to set more than one look and feel (laf) to a java program?

    Hi
    For example,
    I really like the windows system look/feel for the menubar + JTabbedPane etc...
    But i also like the standard Java'a look/feel for some other components like JButton, JSliders etc..
    if so how?
    Cause at the moment i only set laf right at the start of the program (main bit) before i actually initialise the swing ui components, so that they all have my defined laf set
    thanks

    You can add up to three 'aliases' to your account - these are additional addresses (not accounts) which deliver into the same inbox as the main address.
    You set them up at http://icloud.com - go to the Mail page, click the cogwheel icon at top right, choose 'Preferences', then in the pane which opens go to 'Accounts' and click the '+' button below the list area.
    Note that aliases stick permanently with the account which created them. You cannot move them to another account nor turn them into a full account, and if you delete one you cannot reinstate it.

  • [SOLVED] Java GTK look and feel

    I opened a thread recently about replacing the ugly swing buttons in Java applications. After successfully modifying my ~/.bashrc, all was well. However, these new changes were only present when run from a terminal. I assumed it was because my desktop was still running a bash session that hadn't loaded the new options yet, so I restarted.
    Symptom: Java apps launched from the GUI still have old swing buttons, but have the GTK look and feel when launched from a terminal.
    My .bashrc additions:
    # Java stuff
    export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
    I use SLiM for a graphical login experience. Could this be affecting it? I'm not sure what happens differently behind the scenes when using a login manager other than that CTRL+ALT+F7 brings me to my GUI when I use one (because all 6 TTYs are still TTYs).
    Last edited by 2mac (2014-01-02 20:51:35)

    I had a similar issue where .xinitrc wasn't working to set an environment variable. I put mine in ~/.config/openbox/environment and it worked. If you run openbox try that. If using a different window manager maybe try /etc/environment I am unsure of how slim functions though maybe there are config files for it. I think slim is on it's way out though (already lacks some compatibility with systemd; they may fix it though upstream I have no idea). But yeah try the environment file way and see if that does it (assuming you have tested your command from the shell and it works how you want).

  • Problems installing the new 'Look And Feel' done by Francios Degrelle

    I have download the new verison of the new 'Look And Feel' from
    http://sheikyerbouti.developpez.com/forms-pjc-bean/LAF/sources/v133/LAF_133.zip
    1- I defined a new section in formsweb.cfg named summit in the middle tier (AS 10g Rel2):
    [Summit]
    baseHTML=base.htm
    baseHTMLjinitiator=basejpi.htm
    baseHTMLjpi=basejpi.htm
    baseHTMLie=baseie.htm
    HTMLdelimiter=%
    workingDirectory=e:\app\summit
    envFile=default.env
    IE=JInitiator
    escapeparams=true
    form=customers_laf
    debug=no
    otherparams=buffer_records=%buffer% debug_messages=%debug_messages% array=%array% obr=%obr% query_only=%query_only% quiet=%quiet% render=%render% record=%record% tracegroup=%tracegroup% log=%log% term=%term% useSDI=yes
    buffer=no
    debug_messages=no
    array=no
    obr=no
    query_only=no
    quiet=yes
    render=no
    pageTitle=Summit
    serverURL=/forms/lservlet
    codebase=/forms/java
    imageBase=DocumentBase
    width=100%
    height=100%
    separateFrame=false
    splashScreen=no
    lookAndFeel=oracle
    colorScheme=blue
    logo=no
    restrictedURLparams=HTMLbodyAttrs,HTMLbeforeForm,pageTitle,HTMLafterForm,log,allow_debug,allowNewConnections
    serverApp=default
    archive_jini=frmall_jinit.jar
    archive=frmall.jar,laf.jar
    WebUtilArchive=
    jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_09/index.html
    jpi_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
    jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
    2- then I put a copy of the file 'forms.css' in the middle tier in the folder :
    apache\apache\htdocs
    so as to be on the path and then modified PM$CSS_FILENAME in all forms to be 'forms.css' instead of 'c:\forms.css' and recompiled.
    3-I put a copy of the file 'laf.jar' in the folder : 'd\Ora_AS\forms\java' in the middle tier and added this path to the classpath environment variable.
    4- I restarted the middle tier and wrote this URL:
    http://test/forms/frmservlet/config=summit
    the customers form opened but with no background images,I added the following to the URL '&form=test_laf_color_scheme.fmx',the form opened with the default color scheme to 'purple',I changed it from a drop down list to orange and all buttons background color degraded to orange.
    My questions:
    1-where are the background images ?
    2- I cannot compile the 'laf.pll' file to 'laf.plx',when I compile I get this error:
    FRm-91507 -internal error
    P.S. I read this thread :
    FRM-91507 when compiling a library with Forms 6i
    and I didn't understand it,where do I change the Forms_Path? in the forms Home release 1 or Forms home release 2?!!!
    3-Is the 'forms.css' file properly located? if not? where do I put it?
    Sorry for the long scenario but I'm really confused?
    Thanks
    Mohammad

    Hello,
    I'm curently out of everything so I cannot answer this one. All I can tell is that images are read from the client machine or jar file. If you want read images from the application server, you need the http:// syntax.
    Francois

  • Problem setting look and feel

    It seems like I'm not able to change the windows xp look and feel, I'm using this code to change it but nothing happens, the window comes out with windows LAF:
    " public static void main(String[] args)
    try {
    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    } catch (Exception e) { System.out.println(e.getMessage()); }
    new Ventana();
    Maybe... Am I missing some code? or a specific class needs to be downloaded?
    I'd apreciate any help

    That was not the problem, but thank you...
    I finally noticed the problem, what I was trying to do was actually done by writting this:
    JComponent.setDefaultLookAndFeelDecorated(true);
    Sets the OceanTheme feel on, but I noticed that when you try to use it with a Jdialog and a JFileChooser you get some ugly colors. Orange/Brown with JDialogs and Green with JFileChoosers. Is this a bug or it's ment to do that?
    Does somebody know how to fix it?
    Thanks for your support

  • UIX: change image in corporateBranding dependent on choosen Look And Feel

    Is it possible to change a image used in the corporateBranding dependent on choosen Look And Feel?

    If your corporate branding is an image, you can to bind the "source" attribute and return the appropriate image depending on the laf. You can get the laf off the renderingContext. The data binding chapter is here:
    http://helponline.oracle.com/jdeveloper/help/state/content/vtTopicId./navSetId.jdeveloper/vtTopicFile.jdeveloper%7Cuixhelp%7Cuixdevguide%7Cdatabinding%7Ehtml/navId.4/

  • JFrame look and feel

    Hi everybody,
    I'm a beginner in working with Java Look and Feel. I want to customize a frame's title bar, border and buttons. For example I want to put some other icons for the close, minimize and maximize button, change the height and color of the titlebar, and put some other border to the window.
    My question is if I can do this by modifying the LAF. Maybe somebody can give me a link to some good and detailed documentation regarding LAF.
    Thanks.

    Hi,
    You have a better chance to get your question answered if you post this in the Swing forum. (Do also mention that it is a cross-post, and provide a link to this thread)
    Kaj

  • Frame Moving Runtime using Look and Feel

    Hi All,
    I need creating Frame Moving runtime using Look and feel (Oracle forms 10 g with swing concept). If any bodies know give me a idea and demo files.
    Thanks and Regards
    M.Sathiya

    Dear Francois,
    Thanks all are working good and result also perfect but frame and DnD is not properly working compile time no problem only problem is run time it given error :java.lang.VerifyError:(class:oracle/forms/fd/frame$FrameBorder;methed <init> Signature:(Loracle/forms/fd/frame;)V) please tell me how can solve this problem.
    Regards,
    M.Sathiya

  • Look And Feel: Metal Themes

    Hello,
    I have two basic questions I can't find the answer to. I hope someone can help.
    From my understanding of Java 1.5 you now have 2 basic themes to them metal look and feel, they are "Ocean" (the default) and "Steel". Is this understanding correct?
    My second question is, I can switch between Look & Feels, ie. default to system, how do you switch between themes though? I want to use "Steel" but can't !
    Thanks,
    Alan

    How to Set the Lood and Feel:
    http://java.sun.com/docs/books/tutorial/uiswing/misc/p
    laf.htmlThat actually doesn't tell you how to do what he's asking.. at least not from what I saw.
    Here's how to set the metal theme in 1.5:
    import javax.swing.plaf.metal.*;
    public static final String STEEL_THEME_CLASS = "javax.swing.plaf.metal.DefaultMetalTheme";
    public static final String OCEAN_THEME_CLASS = "javax.swing.plaf.metal.OceanTheme";
    public void changeMetalTheme(String themeName) {
       try {
          MetalTheme theme = (MetalTheme)Class.forName(themeName).newInstance();
          MetalLookAndFeel.setCurrentTheme(theme);
       catch (Exception e) { e.printStackTrace(); }
    }Note that if you do this after you've created your GUI, you'll have to call SwingUtilities.updateComponentTreeUI() on all top-level windows.

  • Swing: Look and Feel

    I've found this page with a nice look and feel:
    https://substance.dev.java.net/docs/skins.html#CremeSkin
    But I can't use it.
    I import this:
    import org.jvnet.substance.skin.SubstanceCremeLookAndFeel;
    And do this:
    UIManager.setLookAndFeel(new SubstanceCremeLookAndFeel());
    But the import-libary are not correct. Hope somebody can help me! I'm using netBeans.

    you can add LAF without changing of code. Start app from command line like this
    @call set_classpath.bat
    @set classpath=../../laf/substance.jar;%classpath%
    @java -Dswing.defaultlaf=org.jvnet.substance.SubstanceLookAndFeel myPkg.myApp
    see quick review of LAF's - http://sss1024.googlepages.com/

  • Create or Customize a look and feel

    I'd like to create my own java look and feel and I wonder if a tool that allows to create or customize my laf exists ? What's the better or faster way to do so ?

    LookAndFeel lf = UIManager.getLookAndFeel();
             // Install a different look and feel; specifically, the Windows look and feel
             try {                         //com.sun.java.swing.plaf.windows.WindowsLookAndFeel
                                            //javax.swing.plaf.metal.MetalLookAndFeel
             UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
             } catch (InstantiationException e) {
             } catch (ClassNotFoundException e) {
             } catch (UnsupportedLookAndFeelException e) {
             } catch (IllegalAccessException e) {
             }

  • Chromosomes and genes in portal look and feel

    Hi everybody.
    Has anyone experimented succesfully the use of genes and chromosomes in bea portal 9.2?
    I have troubles with look and feel editor, that doesn't show inlined css, and runtime also, that seems to always
    get the default.chromosome file instead of the one i configured in the .laf file.
    Any point? Thank you.

    In regard to your chromosome not working: if you created your .portal file first, and then changed the .laf file, you'll need to reload the markup from Workshop. See the second bullet item on this link: http://edocs.bea.com/wlp/docs92/portals/develop_portals.html#wp1011140
    If you want, before you do the above, you can check the markup of your .portal file to see if it's correct. Open your .portal as XML, and find the <netuix:lookAndFeel> element. It should have a attributes for skinChromosome and skeletonChromosome that equal your new .chromosome file's name.
    I don't believe that the Look and Feel editor supports inlined CSS rules at this time, but that is an optimization in scope for the next release.
    George

  • Delay in applying Look and feel on jDialog

    I am working with java1.4 / OS as windows Xp.
    Recently i came across an interesting problem regarding look and feel.
    Actually my syatem llok and feel was windows and i set swing application Look and feel as Metal. Now whenever i am launching any dialog on my awing application , The dialog appears in windows LAF for few nenoseconds and then changes to Metal.
    Even if if check the llok and feel just before launcing the dialog i am getting Metal as result
    Can any one help me out about what might be going wrong ?

    I've never noticed this before. (I guiess my eyes aren't good enought to spot something for a few nanoseconds)
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • Implementing Forms look and feel into oracle 10g

    hello, im using oracle 10.1.2.0.2
    i've been trying to implement this look and feel project hours ago here are the steps that i followed:
    # Copy the corresponding JAR file to your /forms/java directory. [copied it to C:\DevSuiteHome_1\forms\java\ and renamed it to laf.jar like mentioned in http://forums.oracle.com/forums/thread.jspa?threadID=693024 but copied also laf_1012.jar  ]
    # Update your /forms/server/formsweb.cfg file.
    As it needs the Sun Java Plug-in instead of the Oracle JInitiator, you have to create a special section that uses the Sun Plug-in.
    You also need to add the corresponding JAR file to the archive tag (not the archive_jini). [modified it to archive=frmall.jar,laf.jar, laf_1012.jar, i didnt know what to do with the Sun Java Plug-in but when i debug and run the oracle there is an icon that shows the java icon launched]
    # Copy the forms.css file somewhere on your disk (by default, it is searched in the C:/ root directory). [done and i've put it in c:\]
    # Compile the laf.pll PL/SQL library, then copy the pll.plx to one of the directories pointed by the FORMS_PATH variable.
    *i've put the laf.pll in my C:\DevSuiteHome_1\forms as shown in the FORMS_PATH of the default.env
    *tried to open the laf.pll from the oracle froms and reports, choosed Program -> Compile PL/SQL -> All, but errors like PKG_DB_LAF_LOV.PREPARE must be declared ...
    *tried to compile it using f60gen module=laf.pll userid=Administrator/pass module_type=LIBRARY output_file=laf.plx batch=yes compile_all=SPECIAL but the f60gen is no where to be found
    *i tried to replace f60gen by envshell.cmd from the $APPL_TOP but i cant find any environment variable called $APPL_TOP, i even searched the whole hard disk for envshell.cmd and couldnt find anything
    Please help as this is the final step of implementation, waiting any response asap!

    Hello,
    Please, don't ask question about the LAF on this forum. Ask them on the dedicated mail address : [email protected]
    Thanks,
    Francois

  • Webutil Open File Dialog look and feel

    Webutil all revisions?, Windows NT 4.0/XP.
    The open/save file dialog boxes in webutil are always the same style (Oracle/Motif?) when either the LookandFeel is set to Generic/Windows or Oracle/Motif.
    Is there anyway to change it to always look like Windows Look and Feel?

    Hello,
    One possible way would be to write your own Java Bean component that call the standard openfile dialog, then set the LAF yourself:
       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
       ...but, I know, this represents some extra work.
    Francois

Maybe you are looking for

  • Where can I learn how FCP references video footage?

    I'm sure this is a basic (but perhaps involved?) question. I've been learning and using FCP on and off for over a year. I've been using online tutorials and developing a basic knowledge of the program. I just bought a new 27" iMac with two internal h

  • Airplay Error -15000

    Connecting to external airplay speakers (pioneer x-smc3-s) on my home wi-fi network results in the above itunes error: An error occurred while connecting to the AirPlay device "Pioneer". An unknown error occurred (-15000). This occurs when trying to

  • Abap Code help for retreiving user ID

    Hi All, I have a field N_BPIID(this field contains User IDs of Users) and variable on this field Z_PIID(Customer exit)........... My requirement is When i execute the report - this variable Z_PIID should automatically  retrive his ID frm BI/BW system

  • I cannot upgrade to FFv4.0, even though I am using OSX 10.5.8, I have 2.25GB RAM and 6.24GB disk space. I can't even give feedback via FF3.6...this is crap!

    I cannot upgrade to FFv4.o. According to Mozilla website software specs (http://www.mozilla.org/en-US/firefox/4.0/system-requirements/), I have to be running either OSX 10.5 0r 10.6 - I am using 10.5.8. So I assume I have the minimum requirement? Und

  • Arroja un error en descarga

    alguien sabe como poder descargar un programa en appstore. es que me iso el cargo a la tarjeta sale que esta listo y que esta descargando, pero en lapso de un tiempo arroja un error y no descarga mas. lo rarro que veo en la descarga es que el indicad