[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).

Similar Messages

  • How to apply XP and GTK look and feel??

    hi..
    please tell me how can I apply XP and GTK look and Feel in my Swing applications??

    hi
    Please visit
    http://www.l2fprod.com/
    Ashish

  • GTK Look And Feel

    I found the source for the GTK L&F in the source files for JDK 1.5 u 1, but when I wrote this code:
    UIManager.LookAndFeelInfo[] looks = UIManager.getInstalledLookAndFeels();
            JRadioButtonMenuItem item;
            LookAndFeelListener listener = new LookAndFeelListener();
            for (int i = 0; i < looks.length; ++i) {
                item = new JRadioButtonMenuItem(looks.getName());
    item.addActionListener(listener);
    menuViewLooks.add(item);
    lfGroup.add(item);
    looksMap.put(item, looks[i].getClassName());
    if (looks[i].getClassName().equals(UIManager.getCrossPlatformLookAndFeelClassName())) {
    item.setSelected(true);
    it looked like the GTK look wasn't installed and I can't use it.
    What should I do to use it in my app?

    Hello Mr.,
    Its good. Thanks for providing convenience. I have a doubt abt for loop
    in the following statement.
    for(UIManager.LookAndFeelInfo look : looks)
    My doubt is what is this kind of for loop. I wanna know abt this varient of for loop detaildly. I have jdk 1.4.2 with me. This code is not getting executed on my system. Whatyare the prerequisites to write that kind of code

  • Gtk+ look and feel looks nothing like Gtk+

    But I guess it feels something like Gtk+. Oh well. I was hoping for something a little more useful.

    Take a blue marker to the screen?
    Some information will possibly get a better answer.

  • Java form look and feel changed

    Whenever I load a java form application now, it seems to have reverted back to some non-native form components e.g.
    http://www.codeproject.com/KB/java/theme/theme.gif
    I would prefer this to return to what it was originally and take on the appearance of a windows application. It may be something I have done in the code at one stage or another, but as it now affects all java applications it must be a global setting which has changed somewhere. Does anyone know where I can find this and change it back?
    Thanks

    Hi Gunja,
    Thanks for your reply but it does not help. My problem is some of the YUI functionalities missing or not working properly after the Portal Component deployed to Portal.
    For example, the YUI Overlay dialog box appears at the bottom right of screen but it is suppose to appear in the middle of screen. It work prefectly outside the Portal as a simple HTML page.
    Any idea from any body?
    Please advice.
    Thanks,
    HauChee

  • [SOLVED] gnome 3 look and feel

    Hello all,
    I did a fresh install of arch and gnome 3 last night.  I am currently running on fallback mode, prefer that mode to the new interface.  The question I have is, is it possible to easily customize/theme Gnome 3 Fallback in Arch to change some characteristics?
    I've run through some of the steps here:  https://wiki.archlinux.org/index.php/Gn … appearance
    however some things don't seem to work yet.  I followed the steps to move the window buttons (close, minimize, maximize) to the left of the window, however the buttons remain on the right.
    I would also like to install an icon theme set, I like the shiki colors in themes, and like the linux mint green.  I'm not sure how to install those, tried the repos, but that didn't work.
    I would also like to see if there is a way to theme the windows, changing title bar color and close, max, min icons.
    A co-worker just installed Linux Mint 12, and is running their Gnome Classic mode, which appears to be fallback mode (I assume), and he can change the themes to icons and windows easily.  Any way to do this in Arch?
    --nixIT
    Last edited by nixIT (2011-12-08 15:26:39)

    nixIT wrote:
    roger that, I have that installed.  Is there a way to install themes in Gnome 3, so they can be selected here?  That's what I'm trying to do.  I looked over the wiki, and that seems to be going right over my head.  Is there an easier way (gui way) to install gnome 3 themes?
    honestly, would love to get the linux mint 12 theme installed/moved over.
    NixIT,
    Installing your themes, icons, etc. is really simple. Themes should be installed into /usr/share/themes  - all that you need to do, is download your theme (un-archive the file), then it is as simple as opening a terminal;
    sudo cp /path/of/your/theme /usr/share/themes
    This will copy the theme to /usr/share/themes, where Gnome-tweak-tool (and also user-theme extension) can see your themes. The next time you open Gnome-tweak-tool your new theme should be available.
    In the Archwiki for Gnome, it also explains how to install icon themes, it works pretty much the same way;
    https://wiki.archlinux.org/index.php/GNOME#Icon_theme
    As far as i know, there is no simple gui tool to install themes/icons in Gnome3. They probably should have carried that feature over from Gnome2, but obviously (for some odd reason) decided not to bother.
    As for your mint themes, just copy them over to /usr/share/themes ...
    cheerz
    Last edited by triplesquarednine (2011-12-07 17:31:35)

  • Good looking �Look and feel� icons ?

    Good looking �Look and feel� icons ?
    Where could be found icons , professional looking, like in �Java TM Look and Feel Graphics Repository� site, for use in JtoolBar For various functions in java application program ?

    (I truely hope I won't start a flame war, but:) I absolutely can't agree with the statement "professional looking, like in �Java TM Look and Feel Graphics Repository� site". If there's one association that comes to my mind when I hear the words "ugly" and "swing" then it's exactly those icons.
    Nevertheless here's something that might help you better:
    I think (but I'm not too sure) that you can use all icons that ship with eclipse (They should be under the CPL and thus you should be allowed to use them). And I beliebe it might be hard to find somebody who perfers the aforementioned icons ;-)
    Another source is http://www.memoire.com/guillaume-desnoix/icones/. Note that the icons have with different licences.

  • How come setting look and feel not successful

    class gameble{
    public static void main(String argv[])throws Throwable{
    try {
    UIManager.setLookAndFeel(
    UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e) { }
    console cs = new console();
    cs.addWindowListener(new GenericWindowListener(cs.tv));
    cs.setLocation(320,0);
    cs.show();
    with the above codes, i want java look&feel, but it still shows me window look & feel. need your help!!

    CroosPlatformLookAndFeelClassName looks almost exactly like the java default look and feel.
    You can try other L&F like:
    try{
    UIManager.setLookAndFeel(getSystemLookAndFeelClassName());
    //this will take the look and feel of the OS you are working with
    catch(Exception e){
    System.err.println(e.getMessage());
    or
    try{
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotiveLookAndFeel");
    //this will take the look and feel of the Unix OS
    catch(Exception e){
    System.err.println(e.getMessage());

  • JTree Button, Line and Java look and feel ?

    Hi all,
    I have 3 small problem with my JTree ..
    1) The 'expand' button size ...
    I set a different Icon for each node in a getTreeCellRendererComponent method (from a class that extends DefaultTreeCellRenderer )...
    The icon are 32x32 pixels.. .and the RowHeight and the Font have been changed too. .
    How to change the size of the expand button (+/-) near the text node ? Because on my JTree, the expand/collapse buttons are really small compare to the icon & row height.
    2) No line appear between the node ...
    I try to set the line style property with -> putClientProperty("JTree.lineStyle", "Angled"); in the JTree constructor OR in the DefaultTreeCellRenderer constructor .. but it doesn't work :/
    3) How to set a Java look and feel for my JTree (actually, I have a Windows look and feel ..)
    I know .. I have grouped 3 question in the same topic ...
    If anyone can help me on one of these subjects. .. Thanks !
    Regards,
    Didier

    So, the Problem 1) is solved ..
    About the Problem 2)
    I put the code UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()) in the main method, like
      //Main method
      public static void main(String[] args) {
        try {
          UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel());
        catch(Exception e) {
          e.printStackTrace();
        new MainApplication();
      }But it only set a Java L&F on the spliter, and on the toolbar contained in my application... Any idea why the title bar is not changed too ?
    (The title bar stay with a Window$ XP L&F ...)
    About the problem 3)
    When I set the L&F->UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); then the lines appear .. ??!! .. if I set again the previous value UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); .. then the lines desappear ..

  • Get rid of that "blue" look and feel which overrides GTK?

    Since Java 5 when you run on a GTK system (or a windows system if I remember correctly) you get a pale blue look and feel in Swing rather than one which looks like your usual operating system's L&F.
    Can that be turned off? :)
    Cheers,
    Chris

    This is weird. I use getSystemLookAndFeelClassName() to set the LaF. It works on my Mac at home and I get the typical OS X Aqua appearance, but on my Ubuntu Linux system at work I just get the Ocean default LaF you mention.
    I'm guessing Ubuntu have done some irritating things with the package because someone who maintains the java stuff at Ubuntu decided blue looks nice or something. I'll see if I can track this down to a problem with the JRE on my system, rather than my code.
    Thanks for the help :)

  • Windows look and feel instead, in InternalFrameDemo.java

    Hi all, I am learning swing and I am trying to modify the
    InternalFrameDemo.java source from
    http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html#InternalFrameDemo
    My idea is to add the line
    JFrame.setDefaultLookAndFeelDecorated(true); in the constructor, but it doesn't work
    and I don't understand why.
    Could somebody please help me?
    Kindest regards,
    Lasse
    public InternalFrameDemo() {
    super("InternalFrameDemo");
    //Make the big window be indented 50 pixels from each edge
    //of the screen.
    int inset = 50;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    setBounds(inset, inset,
    screenSize.width - inset*2,
    screenSize.height - inset*2);
    //FDoesn't work
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Set up the GUI.
    desktop = new JDesktopPane(); //a specialized layered pane
    createFrame(); //create first "window"
    setContentPane(desktop);
    setJMenuBar(createMenuBar());
    //Make dragging a little faster but perhaps uglier.
    desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    }

    Uh I think you're mistaken. Whenever in doubt or something doesn't work as expected, check the javadocs. The link to the javadocs can usually be found really easily by typing "java 6 classname". In this case:
    http://docs.oracle.com/javase/6/docs/api/javax/swing/JFrame.html
    If you want to set the Windows look & feel as your thread title suggests, this was not the method you were looking for as the javadocs will tell you. That method controls if a frame is decorated or not (as the name suggests), which it is by default. Setting it to true will not change anything.
    So what then? You type into Google "java swing windows look and feel". Without quotes of course.

  • Problem with java look and feel

    Hi! This is my first time posting here. Do apologize me if I am not familiar with the regulations here. Thanks!
    Currently, I am developing a project using NetBeans IDE. It is using RMI, and some basic UI. I am facing the following error when I tried applying the java look and feel code. Please see below for the code used and the error message.
    try {   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception e) { }
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.ColorUIResource cannot be cast to java.util.List
    at javax.swing.plaf.metal.MetalUtils.drawGradient(MetalUtils.java:196)
    at javax.swing.plaf.metal.MetalInternalFrameTitlePane.paintComponent(MetalInternalFrameTitlePane.java:384)
    at javax.swing.JComponent.paint(JComponent.java:1027)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
    at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
    at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
    at javax.swing.JComponent.paint(JComponent.java:1013)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
    at java.awt.Container.paint(Container.java:1797)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
    at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Java Result: 1

    Thanks for everyone's help!
    Below is the executable code generated using NetBeans which is enough to generate the error message. Sometimes you can get the error message just by running the program. Sometimes the error will occur when you go into the Menu and click on Item.
    * NewJFrame.java
    * Created on January 8, 2008, 1:11 PM
    package client;
    import javax.swing.UIManager;
    * @author  Yang
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jDesktopPane1 = new javax.swing.JDesktopPane();
            jInternalFrame1 = new javax.swing.JInternalFrame();
            jMenuBar1 = new javax.swing.JMenuBar();
            jMenu1 = new javax.swing.JMenu();
            jMenuItem1 = new javax.swing.JMenuItem();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
            jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
            jInternalFrame1Layout.setHorizontalGroup(
                jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 190, Short.MAX_VALUE)
            jInternalFrame1Layout.setVerticalGroup(
                jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 95, Short.MAX_VALUE)
            jInternalFrame1.setBounds(80, 40, 200, 130);
            jDesktopPane1.add(jInternalFrame1, javax.swing.JLayeredPane.DEFAULT_LAYER);
            jMenu1.setText("Menu");
            jMenuItem1.setText("Item");
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem1ActionPerformed(evt);
            jMenu1.add(jMenuItem1);
            jMenuBar1.add(jMenu1);
            setJMenuBar(jMenuBar1);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
                    .addGap(20, 20, 20))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
            jInternalFrame1.setVisible(true);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
        // Variables declaration - do not modify                    
        private javax.swing.JDesktopPane jDesktopPane1;
        private javax.swing.JInternalFrame jInternalFrame1;
        private javax.swing.JMenu jMenu1;
        private javax.swing.JMenuBar jMenuBar1;
        private javax.swing.JMenuItem jMenuItem1;
        // End of variables declaration                  
    }Edited by: Boxie on Jan 7, 2008 11:23 PM

  • How can I include a portal component look and feel in a java servlet

    Does any body know how can i include a portal component look and feel (tables, buttons, etc) in a java servlet?

    Hi José,
    I don't think that is possible. But you can import the css files that ep uses for its look and feel and try to give your web pages similar look and feel. The tables and other controls used in EP are totally different and are done through complex JavaScript coding instead of simple HTML tags. If you want exact lok and feel then i thin you must go for a Webdynpro based application rather then a J2EE application with JSPs.
    Regards,
    Guru.
    PS: Give points for helpful replies.

  • Setting the Brushed Metal look and feel for macs using Java.

    Hello,
    I am relatively new to Java and I am new to Mac-specific java stuff. Anyways, when I try to set the look and feel of my classes to the "apple.awt.brushMetalLook" look and feel, I am unable to. It works if I have System.setProperty("apple.awt.brushMetalLook", "true"); written before I create any swing component. This would be fine, except that means that it is impossible to extend any swing component, such as JFrame or JApplet. Is there a way around this?
    Thanks!

    This might answer your question:
    http://lists.apple.com/archives/Java-dev/2003/Apr/msg00829.html

  • Does java has "Transparent" look and feel?????

    I want to know whether there is a transparent look and feel developed for java,
    if it is there please post an link to download the API
    Thank you very much..

    As far as I know, NO.
    There is a way to do this, using robot to get desktop image and draw it using paint object when you render your component, but, performance is not good.

Maybe you are looking for

  • Maintenance view settings

    Good morning.  I created a maintenance view for one of our custom tables, and we're having some problems with it.  The table was originally set under "Delivery and Maintenance" as delivery class C (customizing table), with "Display/Maintenance Allowe

  • 'Database logon failed (LO 26603) - Please HELP ME!

    Hi everybody... i need your help for an authentication issue whit LIVE OFFICE connections from Xcelsius2008 to Crystal Report Server 2008. I've just connected other reports data in Xcelsius2008 but generating the SWF sometimes the SWFs can not logon

  • Should I use Borlands Basic Wizard class?

    Hi, I am just about to start programming a wizard for my Swing application. I am using Borland JBuilder as an IDE and in the help file found a class called "Basic Wizard". Is this not an official class? If the answer is yes, is it advisable to use th

  • Macbook Pro (purchased Dec 2010) OS 10.9.5 Internet connection problems via Belkin ethernet

    Hello. I've just moved to an old house with very thick walls and positioning my BT router close to my Macbook is a problem due to the location of the BT box and powerpoint. I can connect to the router with WIFI but it's a little clunky and slow. I'd

  • Applicant D/B - Employee D/B

    Hi Experts, Question - When during Applicant data entry there is a option to refer a advertisement/instrument for the applicant, after data transfer to Employee D/B where exactly is this information transferred to? Requirement - I would like to captu