473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

alignment problem in JPanel

65
i add a panel (P1) to a frame ,
then i add three panels(panA,panB,panC) to this panel (P1) using BoxLayout.
then i add two buttons to the panel panC which is at the bottom of P1 .
but i cannot align this buttons as i want.
they stay as TOP_ALIGNMENT although i want them to be located BOTTOM_ALIGNED

what can be done to solve this porblem?
Sep 12 '07 #1
2 3437
JosAH
11,448 Expert 8TB
i add a panel (P1) to a frame ,
then i add three panels(panA,panB,panC) to this panel (P1) using BoxLayout.
then i add two buttons to the panel panC which is at the bottom of P1 .
but i cannot align this buttons as i want.
they stay as TOP_ALIGNMENT although i want them to be located BOTTOM_ALIGNED

what can be done to solve this porblem?
Maybe the Box class can be of help; that class has a couple of static
methods available that can create rigid areas for invisible components of a
fixed width/heigth, or glue (or antiglue) or struts that keep other components
apart. Read the API docs and add one of those between the panels.

kind regards,

Jos
Sep 12 '07 #2
praveen2gupta
201 100+
i add a panel (P1) to a frame ,
then i add three panels(panA,panB,panC) to this panel (P1) using BoxLayout.
then i add two buttons to the panel panC which is at the bottom of P1 .
but i cannot align this buttons as i want.
they stay as TOP_ALIGNMENT although i want them to be located BOTTOM_ALIGNED

what can be done to solve this porblem?
Hi
It would be better to see code and problem. You can also use BorderLayout
for it.Better post your code.
Sep 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Hal Vaughan | last post by:
I have a JPanel in a window and I am putting different components in it as the user goes through a setup wizard. In theory, I have an array of components (other JPanels), and I want to step...
3
by: Moth | last post by:
I have a PlotPanel class that extends JPanel which I have used previously to display charts in swing guis. I now want to display a graph in a jsp page so I was going to generate the graph and then...
1
by: M.Kamermans | last post by:
I have a rudimentary gui with a class that extends JPanel, which sets its content to a jpg image using: if (im != null) { g.drawImage(im,0,0,null); } in the paint() method. However, when I...
6
by: davedwm | last post by:
I'm trying to display a grid of TextPane's that are sized to fit a JPanel i've drawn into a Dialog class, the number of 'Cells' are entered into JTextFields and when the appropriate button is hit...
1
by: dishal | last post by:
Hi, Im having a problem with typing on the JPanel. The thing is, that it works perfectly fine when this line " content.add(jp, BorderLayout.NORTH); " is taken out (its the buttons panel) but when its...
9
by: aleplgr | last post by:
Hello, in this code suppose that the dlg is defined in one case as a JDialog, I run it and it seems that the JDialog is executed AFTER closing it, so the message is printed after closing the JDialog....
5
by: James Barrett | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I am experimenting with JApplet and JPanel. My JApplet contains a JPanel called jpanel1 size 210x210. I created a class myPanel which...
1
by: rpm27 | last post by:
I'm new to Java. I am starting to understand Java GUI dimension (the swing library), and I need someone to clarify something to me: As far as I know, JFrame objects provide a window (with the...
8
by: eddiewould | last post by:
Hi, I want to write a custom widget which will act similarly to a JPanel (i.e it can contain other Components), but semantically it's not a kind of JPanel so it shouldn't extend from it. Here is...
1
by: Akino877 | last post by:
Hello, I have a question regarding Java and Swing programming I wonder if I could ask the forum for some help. I have a JPanel that has a couple of radio buttons and an "OK/Next" button on it. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.