Size of GridLayout

  • Permalink
  • submit to reddit
  • Email
  • Follow


How do I set the size of one "cell" in a GridLayout?


0
Reply Jo 4/10/2004 3:27:50 PM

See related articles to this posting

"Jo" wrote...

> How do I set the size of one "cell" in a GridLayout?

You don't...

To "set the size on a singular cell" is rather another paradigm on how
layouts are made, than the underlying premises on how the LayoutManagers
work.

The use of exact pixel sizes was more or less abandoned for the use of
relative sizes. This is to some degree based on the premise that you would
probably prefer the look of the layout to adapt more to the actual
platform...

To make a long story short:

Say for example that you define a panel with a GridLayout(3, 2).

If the size of the panel is height 60 and width 30, then *each* cell will be
height 20 an width 15.

If you change the size of the panel to height 30 and width 60, the size of
*each* cell will be height 10 and width 30.

As you see the sizes of the individual cells are set "relatively" to the
size of the container.

// Bjorn A


P.S.

Questions of this kind should only be posted to comp.lang.java.gui.
No sense in posting it to comp.lang.java.programmer.


0
Reply Bjorn 4/10/2004 4:10:14 PM

"Jo" <mmmmm@spamtrap.com> wrote in message
news:c593nj$2qfp46$1@ID-83837.news.uni-berlin.de...
> How do I set the size of one "cell" in a GridLayout?
>
GridLayout is simply a convenience mechanism to avoid you having to
explicitly specify the position of every component on a panel.   The layout
takes the size information for each of the components and calculates where
they should be within the enclosing component.  You set the size information
of the individual components.  This can be done even after they are added to
the enclosing component as long as it is before you pack the frame the
component is displayed in.


0
Reply Jim 4/10/2004 9:12:07 PM
comp.lang.java.gui 8292 articles. 14 followers. Post

2 Replies
204 Views

Similar Articles

[PageSpeed] 35

  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Preferred Size, Minimum Size, Size
I'm a little confused when I should use the various JComponent methods: setPreferredSize, setMinimumSize and setSize. From what I can tell: setPreferredSize(Dimension) - This is (obviously) the preferred size of the component. As far as I can tell, this is used to determine what size the component should be when pack() is used. setMinimumSize - The component cannot be any smaller than this. setSize - Set the current size (hard value). What I'm confused about is... 1. When I should use each method. 2. Currently, when I resize a frame, the JTextBoxes will resize for part of the ti...

Die size, pitch size?
Dear When I look at Virtex-II Pro data sheet (DS083 v. 4.5), page 7, I see following table. ------------------------- Package FF896 Pitch (mm) 1.00 Size (mm) 31 x 31 ------------------------- I guess that Distance between neighbor pins = 1 mm Die size = 31 mm x 31 mm Could someone explain this? Am I correct? Pasacco <pasacco@gmail.com> wrote: > Dear > When I look at Virtex-II Pro data sheet (DS083 v. 4.5), page 7, > I see following table. > ------------------------- > Package FF896 > Pitch (mm) 1.00 > Size (mm) 31 x 31 > ------------------------- ...

Reduce size of EPS size
Dear all, I have to produce some EPS figures with high resolution (600dpi) showing isosurfaces created in matlab. The problem is that the resulting file is almost 60mb. Is there some trick to use to reduce the size of the final files? Thanks a lot for the help! Dear Luca, Is using the Painters renderer in Matlab possible? Kind regards, Jan ...

Font size and plot size.
Using version 7.1, I have a plot that I make and it looks fine. I put a title on the plot it looks fine. The boss wants the font of the title and x and y labels bigger, so I set(0,'DefaultTextFontSize',24); set(0,'DefaultAxisFontSize',24); as the first 2 lines of my m file. Now the plot looks like hell because the title is clipped. Why isn't matlab 'smart enough' to figure out that it needs to make the plot smaller? What do I need to do to not have the title clipped? (new boss and/or smaller font size are not viable options :-) Bruce -- +-------------...

ping size and mtu size
Hello, I set up a gateway machine with Debian woody an DSL. Now I find that ping doesn't work with sizes greater than 1424. After looking in this newsgroup I examined some settings of MTU size: my /etc/peers/provider includes the following lines: .. . . pty "/usr/sbin/pppoe -I eth1 -T 240 -m 1412 .. . . mtu 1452 .. . . Modifying the "mtu 1452" line affects the possible ping size, but it is always limited to about 20...30 bytes lower than the mtu value. What to do for sending greater pings i.e. breaking / reassembling greater packets into pieces? Thanks in advance, Uwe ...

Table size and index size
I am trying to write a sql script to estimate size and count of rows of all tables and indexes within a schema. Here's what I have so far but need a little help. #$1 is database name and $2 is schema name db2 connect to $1 db2 select tabname,t1.fpages * t2.pagesize as bytes from syscat.tables t1, syscat.tablespaces t2 where t1.tabschema='$2' and t1.tbspace=t2.tbspace How can I add the index_size for each index under a table? #syscat.indexes lists nleafs but it doesn't compute. How can I list the number of rows for each table as I progress through the query. ...

Extent Sizes and Page sizes
Can anybody explain to me the relation between extentsize and pagesize. When I am creating a new tablespace what do I need to be careful of? Say pagesize is 8K is keeping extentsize(pages) 64 too large? What exactly is the relation? Thanks For a tablespace, you need to define the size 4,8,16,32k) of the page that will hold the data. Each tablespace of a page size must have access to bufferpool of same page size and a system temporary tablespace of same page size. The extent size determines the number of those pages that db2 will use to manage the physical allocation of dis...

size specification in size constant
Hi Consider following size constant -- "temp = 10'd28". Now I want to replace 10 with parameter TEN = 10; i.e temp = TEN'd28. But compiler is giving error for above expression. It is allowing me to use `define TEN 10 and `TEN'd28. I donot know my complain is valid or not but it is stupid thing. I donot want to use `define construct instead my pref is parameter construct. Is there any way I can use parameter and write temp = {parameter'd28} Regards "sandeep" <sandeepkumar.sah@gmail.com> wrote in message news:b189510a-2767-431a-bb99-019f...

font-size starting size
Hello, I just joined this group and saw the discussion "What do you think of resizing 1em to 10px?" I am somewhat confused by what y'all think should be used as a reference size. I was surprised that someone actually suggested ems as a reference. Ems are relative to a selected point size, the width in points of a capital M. If no point size is given, what size does an em become? The browser obviously must decide. Also setting the body text to 62.5% is, well, stupid. % of what? I should *assume* 16 pixels? Bad thinking. And not my experience with browsers. ...