Re: A 'greedy' component...
Rob McDonald <robm@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> I have developed a graphical interface extended from java.awt.Component. It
> is drawn using Graphics2D objects, and is nicely interactive.
>
> When the interface is placed in a JPanel, which is placed in a JFrame,
> everything works great. My interface checks the its size, and calculates
> the size & placement of all the internal stuff.
>
> However, when you try to put anything else in the JFrame or JPanel, my
> component gets shrunk to a point, and isn't displayed.
>
> How can I make a component's default behavior to be to expand to fill all
> available space?
This isn't about the component, but rather about the layout manager in
the container. What layout manager are you using for the JFrame's
content pane? How about for the JPanel?
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.
Relevant Pages
- Re: How does a layoutmanager set the size of a component?
... calculations on the JPanel when the JFrame is resized, ... the setSize method of JPanel. ... a specific layout manager does. ... (comp.lang.java.gui) - Re: How does a layoutmanager set the size of a component?
... Now I decided to do some calculations on the JPanel when the JFrame is resized, so I overloaded the setSize method of JPanel. ... it's not a good idea to rely on what a specific layout manager does. ... (comp.lang.java.gui) - get the value of the position of JPanel inside the JFrame
... I have a JFrame and inside two JPanel one of them is on NORTH and the second ... And When I get the Container which is the JPanel, ... Les informations contenues dans le present message et dans tous les fichiers electroniques qui y sont attaches, sont strictement confidentielles et ne sont destinees qu'a l'usage de la personne dont le nom apparait ci-dessus et de toute autre personne specifiquement autorisee a les recevoir. ... (comp.lang.java.programmer) - Re: Please help the GridLayout problem
... I am tring to add several small JPanel to a big JPanel (using ... should never add components directly to a JFrame. ... your panels should be nor how big the JFrame should be. ... And since the GridLayout layoutManager's layout strategy ... (comp.lang.java.gui) - Re: odd mouselistener issue
... I've got a JFrame with borderlayout. ... So all I can do is give you an example of how to add a MouseListener to a JPanel. ... Don't forget that BorderLayout will cause your component to expand to the size of your container. ... public static void main{ ... (comp.lang.java.programmer) |
|