Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7973261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:03:47+00:00 2026-06-04T08:03:47+00:00

I have a subclass of JFrame(it contains JButton, Title and Jpanel) and i added

  • 0

I have a subclass of JFrame(it contains JButton, Title and Jpanel) and i added a JPanel to it. Jpanel occupies center portion of borderlayout. I want to make JPanel to be transparent(it should see through the Frame window).

As i am doing it for Java 1.5, I used JFrame.setOpacity(0.0f) to set transparency of Jframe. By doing this all Components of JFrame(ie. button, Title ahd jPanel) are using same alpha level. But I want only JPanel to be Transparent.

I experimented with JLayeredPane by changing Z-order with the same result.

I am open to use external libraries like JNA(JNA windowsUtil is also doing the same as setOpacity() method) and using classes of java7 or java6 as external libraries to my application .

I even gone through some previously asked questions with no help:

Opaque components on transparent Java windows

Java: Transparent Windows with non-transparent components?

Re-paint on translucent frame/panel/component.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:03:48+00:00Added an answer on June 4, 2026 at 8:03 am

    Use JNA’s WindowUtils.setWindowTransparent() method to start with a completely transparent window. Any pixels painted into that window will have their alpha component preserved.

    JFrame f = ...
    WindowUtils.setWindowTransparent(f, true);
    // ensure JPanel content pane doesn't paint its (solid) background
    f.getContentPane().setOpaque(false);
    // Any other added components will be painted normally
    f.getContentPane().add(new JButton("I'm opaque"));
    

    This should deliver the desired results.

    If you want your container to be semi-transparent, or other opacity combinations, you’ll need to clarify your desired results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a subclass of JPanel , and I want it to, as soon
I have a fractal generation component (a subclass of JPanel) inside a JFrame. When
HI All. I have subclass of UIScrollView. IN this class I have added some
I have a subclass based on UIView and i want to change the tint
I have a subclass and I want it to not include a class attribute
Say, you have a subclass of JFrame , and use it to create your
I have created a JFrame subclass containing 9 JPanels using a GridLayout (3x3). I'm
Im have a subclass of UIView, called PinView, which contains an image. Basically PinView
I have a subclass of JFrame A. I have another class B which is
I have a subclass of UITableViewController , and I want to add a view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.