This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Ranch Office and the fly likes Transparent Buttons in Layered Pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "Transparent Buttons in Layered Pane" Watch "Transparent Buttons in Layered Pane" New topic
Author

Transparent Buttons in Layered Pane

Glenn Puckett
Greenhorn

Joined: Sep 09, 2008
Posts: 16
I have read all the forums about setting up transparent buttons in layered panes. But for the life of me I can't get them to work. I have two png files set up with transparent backgrounds. But when the window is displayed the background of the button shows up as a light gray and not the least bit transparent.

The background layer is displaying an animated moving map. The two buttons zoom the map in or out. I want them to hover over the map. I have also tried using JLabel with the same basic results. The action code for JButton is simpler. Here is the code that sets it up:

The class is named Leap and extends JFrame.





What am I doing wrong? Thanks for your help.
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 155
crossposted
Glenn Puckett
Greenhorn

Joined: Sep 09, 2008
Posts: 16
m Korbel wrote: crossposted


I posted to another forum. What is the problem with that? Different people read different forums. This is not posted duplicate in JavaRanch.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Different people read different forums

yes,and when they reply the posts are
often the same, meaning the person replying
second has totally wasted his/her time.

if out time is unimportant to you, you
getting a solution is equally unimportant to us.

had you linked the posts so all could see
if any replies, all would be good.
Glenn Puckett
Greenhorn

Joined: Sep 09, 2008
Posts: 16
Michael Dunn wrote:> Different people read different forums

yes,and when they reply the posts are
often the same, meaning the person replying
second has totally wasted his/her time.

if out time is unimportant to you, you
getting a solution is equally unimportant to us.

had you linked the posts so all could see
if any replies, all would be good.


What is interesting is that you took the time to make a big deal of what you call a cross post when nobody has even bothered to respond. You are the one wasting time, not me. Obviously being the forum police is part of your job description. A cross post is when you ask the same question in multiple areas of the same forum, which I did not do.

I made no attempt at wasting people's time. As I said, different people read different forums. So I don't consider that a waste of time. It is difficult getting answers on forums. Especially with busy bodies like you policing the web. There are a dozen different forums with similar questions and with similar answers. Since none of them appear to work for me I would like to have the opportunity for someone to help. But you are too busy making big deals of what you consider a big sin.

why don't you try to provide an answer instead of giving me a hard time? If you don't have an answer why not keep your nose out of it? Maybe as soon as I got an answer that works I would cancel the other forum(s) posts(s).
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
I am afraid MD and MK are correct. You are not wasting people’s time by posting twice, so much as not saying you are posting twice. There is no need to call people forum police or busy bodies. You have had a good explanation of the problem already from MD, who was not rude to you.

This is not the appropriate place for such discussions; I shall move this discussion elsewhere.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18765
    
  40

Just to be clear, the ranch does *allow* crossposting (to external forums) ...

http://www.coderanch.com/how-to/java/BeForthrightWhenCrossPostingToOtherSites

However, we do want you to be forthright about it. Not doing so, tends to annoy your fellow ranchers ... which of course, you already noticed.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
all you have to do is link the posts.

that way, everyone (in all forums) can see if the problem is solved,
or if there are any suggestions that have not worked i.e. no point duplicating
what has already been suggested.

also is beneficial to those who search first for answers - someone finds a similar
post/problem at forumA. There is a link to forumB. The solution is there.
Glenn Puckett
Greenhorn

Joined: Sep 09, 2008
Posts: 16
I have one last comment and then I'll go away and never come back. Instead of the guy posting what he did he could have sent me a message letting me know how to properly accomplish what you are suggesting. I am a busy programmer simply trying to get a frustrating issue resolved. Instructions for properly cross posting to external forums may be on your site somewhere. But I simply don't have time to research each and every forum for this sort of stuff. I am on forums all the time as that is my ONLY source of potential solutions to my challenges and getting help with those I can't find an answer to. 9 times out of 10 nobody will answer. That's fine, this is entirely volunteer I understand. So the only hope is to post enough places that someone willing to help will see it and do so. Instead of helping me out he came across like some 6 year old child saying "nanana boo boo I caught you". I don't need that nor will I accept it. If we can't be adults in a situation like this then it's simply not worth the effort.

Your assumption is that everyone reads all forums. I think that is a bad assumption. But it's your forum. You can assume anything that you please. Obvious folks in this forum are more interested in who breaks the rules than who gets answers.
dennis deems
Ranch Hand

Joined: Mar 12, 2011
Posts: 808
It has nothing to do with getting caught breaking a rule. What you're saying is that your time is precious, but the time of anyone who might be moved to help you is worth nothing.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3506
    
  14
Instead of looking at m korbel's post as a criticism of you, why don't you think of it as a friendly head's up to everyone else ?
Basically (s)he's saying - I noticed the OP has posted the same question on another forum. I guess it slipped his mind to include a link, so I'm doing that for him so that my fellow ranchers can check it out and avoid repeating any information he's already received.


Joanne
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 155
I want to marked your question with HomeWork tag, your question is your mirror, may be
this is reason why isn't answered nor commented on both forums, sure stop with FlameWar

___________________________________________________________________________

for your idead to use

- proper LayoutManager for all JComponents, dont use setSize, setBounds,
setPreferredSize (excluding empty JPanel, JComponent and JScrollPane),

- LayeredPane (layers) required PrefferedSize, setSize, setBounds


__________________________________________________________________
better could be to use instead of JLayeredPane

- JLayer (Java7 ) based on JXLayer (Java6)

- GlassPane (required deepest knowledge about Swing & LayoutManagers)

- JViewport (required deepest knowledge about Swing & LayoutManagers,
notice have to override setScrollMode(JViewport.XXX_SCROLL_MODE);)
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20545
    ∞

There is a new feature coming soon that will allow a single thread to appear in more than one forum. If you read the thread in one forum, and then go to a second forum, the thread will be marked as already read in the second forum.

We are also exploring the idea that the primary forum view might be something that is a collection of ALL threads site wide. Like one huge forum. And, further, you will be able to specify topics that you are or are not interested in, in this uber massive view. The old view will still be available also.




permaculture Wood Burning Stoves 2.0 - 4-DVD set
dennis deems
Ranch Hand

Joined: Mar 12, 2011
Posts: 808
paul wheaton wrote:There is a new feature coming soon that will allow a single thread to appear in more than one forum. If you read the thread in one forum, and then go to a second forum, the thread will be marked as already read in the second forum.

We are also exploring the idea that the primary forum view might be something that is a collection of ALL threads site wide. Like one huge forum. And, further, you will be able to specify topics that you are or are not interested in, in this uber massive view. The old view will still be available also.





If what I have just seen today is an example of this new feature (the thread about Secrets of the JavaScript Ninja) it is VERY cool. Thanks for ongoing improvements to the site!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transparent Buttons in Layered Pane