Results 1 to 13 of 13
  1. #1
    nicocannon is offline Member
    Join Date
    Dec 2014
    Posts
    30
    Rep Power
    0

    Angry setOpaque not working on linux

    I have a application that I have been developing on mac and it all good and working. I exported it to a runnable jar then executed it on my mac and it work all good and fine. Then I put it on my linux VM(lubuntu) and ran it. It loads everything fine but the panels aren't transparent. The panels are inside a tabbed bar and the JFrame has a background image that you are supposed to see through the panels in the tabbed pane. This all works fine on OSX but not linux why? and how can I fix this issue?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: setOpaque not working on linux

    Please provide a Short, Self Contained, Correct Example.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: setOpaque not working on linux

    And how does it work on Windows?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,143
    Rep Power
    14

    Default Re: setOpaque not working on linux

    Transparency isn't supported on every system. A quick google will give you a ton of results, including this explanation: java swing transparency issues under linux - Stack Overflow

    I've seen this on Linux as well, especially if you're running something like a VNC session where you don't have access to the GPU.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  5. #5
    nicocannon is offline Member
    Join Date
    Dec 2014
    Posts
    30
    Rep Power
    0

    Default Re: setOpaque not working on linux

    OK I just got a new windows 8 laptop and the same thing is happening as well. Its the exact same code and all the panels inside this tab bar all have "panelName.setOpaque(false)" on them and it only works on mac. On windows and linux it just has this metally blue look where it is meant to be transparent.

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: setOpaque not working on linux

    Quote Originally Posted by nicocannon View Post
    OK I just got a new windows 8 laptop and the same thing is happening as well. Its the exact same code and all the panels inside this tab bar all have "panelName.setOpaque(false)" on them and it only works on mac. On windows and linux it just has this metally blue look where it is meant to be transparent.
    That doesn't help much. Did you read my first post?

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: setOpaque not working on linux

    Quote Originally Posted by nicocannon View Post
    Its the exact same code
    Quote Originally Posted by jim829 View Post
    So where's that SSCCE?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: setOpaque not working on linux

    Quote Originally Posted by KevinWorkman View Post
    Transparency isn't supported on every system.
    That would be about transparency / translucency of top-level windows. Not JComponent subclasses.

    If is important for the OP to understand the contract of setOpaque(...) as stated in the API.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: setOpaque not working on linux

    Quote Originally Posted by jim829 View Post
    That doesn't help much. Did you read my first post?

    Regards,
    Jim
    Yeah yeah, always a minute too late...

    The late db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  10. #10
    nicocannon is offline Member
    Join Date
    Dec 2014
    Posts
    30
    Rep Power
    0

    Default Re: setOpaque not working on linux

    Code for setting my JPanels transparent:
    Java Code:
    JPanel panel = new JPanel();
    panel.setOpaque(false);
    Thats literally it. And it is not working on linux and windows.

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: setOpaque not working on linux

    So you don't really want help?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  12. #12
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: setOpaque not working on linux

    Quote Originally Posted by nicocannon View Post
    Code for setting my JPanels transparent:
    Java Code:
    JPanel panel = new JPanel();
    panel.setOpaque(false);
    Thats literally it. And it is not working on linux and windows.
    Interesting! I wasn't able to compile and run that code. Perhaps you omitted some stuff.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  13. #13
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,143
    Rep Power
    14

    Default Re: setOpaque not working on linux

    Quote Originally Posted by DarrylBurke View Post
    That would be about transparency / translucency of top-level windows. Not JComponent subclasses.
    Whoops, good call. Sometimes I don't read so good.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. Replies: 0
    Last Post: 06-04-2013, 11:52 AM
  2. a setOpaque(false) JPanel is not transparent
    By imorio in forum AWT / Swing
    Replies: 9
    Last Post: 09-01-2010, 09:02 PM
  3. executing linux command from Java not working.
    By baozhi in forum Advanced Java
    Replies: 2
    Last Post: 03-24-2010, 06:32 AM
  4. Keyboard key are not working in solaris and linux.
    By dinesh kaushik in forum AWT / Swing
    Replies: 1
    Last Post: 12-22-2007, 04:18 AM
  5. Mouse Right click option not working in solaris and linux OS
    By dinesh kaushik in forum AWT / Swing
    Replies: 2
    Last Post: 11-21-2007, 04:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •