Re: JButton is incomplete
- From: Ian Shef <invalid@xxxxxxxxxxxxx>
- Date: Wed, 28 Nov 2007 19:27:04 GMT
felix <ckpradip@xxxxxxxxx> wrote in news:2ab5cebf-5e80-476c-80f5-
4e74b9a54764@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
<snip>
I have placed a button in a gridBagLayout(1, 3).No. You placed a button into something (perhaps a JPanel?) with a
FlowLayout.
The something was placed into a JPanel with a GridLayout (not
gridBagLayout, not even GridBagLayout).
Presumably, this JPanel was placed into something else unknown with an
unknown LayoutManager.
Words can be misleading. Code can be misleading, but usually less so. A
good example of why an SSCCE is important.
When I reduce theThe JPanel has a GridLayout
size of the screen, the button is split. I do not want it to happen
this way.
I have placed the code snippet below
/* Code starts here */
JPanel p = new JPanel();
p.setLayout(new GridLayout(1,3));
Whatever m_refreshPan is, it has been added to the JPanel.
p.add(new JLabel(""));
p.add(m_titleLabel);
p.add(m_refreshPan);
m_refreshPan has a FlowLayout
m_refreshPan.setLayout(new FlowLayout(FlowLayout.LEFT));
m_refreshPan.add(m_label);Assuming that m_button is the button (Button? JButton?) of interest, it is
m_refreshPan.add(m_button);
in m_refreshPan which has a FlowLayout.
/* Code ends here */
--
Felix
An SSCCE would really help. So would a screen shot or other description of
the meaning of "the button is split."
I want to help, but need better to go on.
--
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *
.
- References:
- JButton is incomplete
- From: felix
- JButton is incomplete
- Prev by Date: Re: JButton is incomplete
- Next by Date: Project ideas
- Previous by thread: Re: JButton is incomplete
- Next by thread: Re: JButton is split
- Index(es):