• Post Reply Bookmark Topic Watch Topic
  • New Topic

invisible canvas  RSS feed

 
Ryan Deiter
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read somewhere that you can't have invisible canvas's. What I am trying to do is create a login screen for an applet I am working on. I am rendering a cool background for my login screen in the paint method. Now I want to add buttons and such over it. To organize everything I am using a gridlayout. I add a Panel to each of the cells and then add my buttons to those panels (so they don't get resized). The background color of the panel covers up the image I rendered. Is there some way to add the button on to something that doesn't cover up my image.
Thanks,
Ryan
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about rendering the image to the Panel?
I think, a panel can't be transparent.
 
Ryan Deiter
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying to find the easiest way of getting what I want and I am finding out that there is no easy way. This is exactly what I am doing. I am creating a class that extends Panel. This class is added to bigger layout scheme. In its paint method I am creating a RoundRectangle2D with a GradientPaint over it that looks really sharp. I want to place textfields and buttons inside(on top) of my RoundRectangle2D. I am setting my object's layout manager to GridLayout. In each of the cells I create a new Panel and add my components to each panel so they don't get resized. This is my problem. The background of the new panels cover up my RoundRectangle2D. I am just hoping that someone has a suggestion of a different way of doing this are how I can do this.
Thanks,
Ryan Deiter
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you change your GridLayout to a GridBagLayout, then you could add your textfields and buttons directly to the background panel without them being resized. I think that would be a lot easier than trying to make a transparent panel.
 
Ryan Deiter
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Angela
Ryan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!