This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Mixing components with paint() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Mixing components with paint()" Watch "Mixing components with paint()" New topic
Author

Mixing components with paint()

Mark Owens
Greenhorn

Joined: Feb 24, 2000
Posts: 26
Hey all,
The beginner program that I am working on has both drawn items (fillOval, drawRect, etc.) How can I place buttons near these drawn items?
I have done what I can with layout managers already. I tried to separate the component portions and the drawn portions such that the components were on panels and the drawn portions are on canvases and these are added to a layout manager. But there are certain places where I want to put a button right next to a "knob" that I have drawn...
All help appreciated,
Mark
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20586
    ∞

I would try the null layout manager. This is where you pass a null in when a layout manager is asked for. The downside is that you need to call setBounds() for every component - but! you do get exact placement!


permaculture Wood Burning Stoves 2.0 - 4-DVD set
 
GeeCON Prague 2014
 
subject: Mixing components with paint()