• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

invisible canvas

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Angela
Ryan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic