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 8293 articles. 15 followers. Post

2 Replies
324 Views

Similar Articles

[PageSpeed] 56


  • 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. ...

Bitmap size to wxFrame size
I'm allocating a frame in the MyApp:OnInit method but cannot figure out how to translate the size of the background bitmap to a logical size which makes the frame fit around perfectly. Shouldn't these methods be used when calculating the arguments to the MyFrame (wxFrame) constructor? wxCoord cx = dc.DeviceToLogicalX(wxCoord(x)); wxCoord cy = dc.DeviceToLogicalY(wxCoord(y)); If I supply the x-size and y-size of the bitmap to the above functions and then use the results in the wxSize argument in the MyFrame constructor, then the size is wrong. Why? M --------...

size of physical memory is given by size of address registers in CPU or size of address bus??
i have read when we move from 32bit machine to 64bit, the size of physical memory increases from 4GB(2pow32) to 16exabytes(2pow64). So it means that size of physical memory is limited by size of address registers in the CPU. Now as per 8086 architectute, registers are 16 bit but address bus is 20bit. So it says that we can address 2power20 memory locations using register values+offset. Here size of physical memory is working according to address bus(20 bits) and not registers(16 bit). So my query is whether it is size of address registers that determine the size of physical mem locations we ...

size of physical memory is given by size of address registers in CPU or size of address bus??
i have read when we move from 32bit machine to 64bit, the size of physical memory increases from 4GB(2pow32) to 16exabytes(2pow64). So it means that size of physical memory is limited by size of address registers in the CPU. Now as per 8086 architectute, registers are 16 bit but address bus is 20bit. So it says that we can address 2power20 memory locations using register values+offset. Here size of physical memory is working according to address bus(20 bits) and not registers(16 bit). So my query is whether it is size of address registers that determine the size of physical mem lo...

Size
Hello,I need to resize a JFrame (with caption) so that the client area is exactly 640x480. If I do a setSize(640, 480) the client area is smaller due to the caption and border of the frame. I need to get the size of the caption and of the borders. But where can I find that information? (or is it a way to resize the frame base on the client area size?)Thanks, Francois On Apr 1, 3:01 am, "Francois Lionet" <flio...@hotmail.fr> wrote:Sub: Size'Size matters', but note that much more importantthan size, is a meaningful subject line.For instance.. 'size of GUI client area...

Size
Hi all, My code(c/c++) runs as a server on a gnu/linux box. it does multithreading, socket and database(oci) stuff. The problem is that by using top I found its "size" and "rss" are around 150M, and it takes 3.7% under " %mem" at run time. Is it normal? if not, any clues on fixing it. TIA -s "Sam" <sam@somewhere.com> wrote in message news:wpMJa.16004$6o.7103@news.primus.ca... > Hi all, > My code(c/c++) runs as a server on a gnu/linux box. it does multithreading, > socket and database(oci) stuff. The problem is that by using top I f...

GridLayout
Hello all! I have a jpanel to which I have set a layout of GridLayout(0,1,10,10). Within this panel I have 3 ImageIcons. When I startup the application, the ImageIcons are spread out evenly using the available space, and when I resize it, the hgaps and vgaps are respected, and the ImageIcons moved according to the panel size. But... I do not want the 3 components to use all available space. I want them to be aligned at the center top of the JPanel, and that when the application is resized, the hgap/vgap sizes remain the same, and that instead of occupying all avalable JPanel space, the I...

size
Hi, Is it possible to specify the max size of an xml tag in the dtd ? For example if I want to limit the size of a <name> tag to 50 is there a method to do it in the dtd ? regards seb wrote: > Is it possible to specify the max size of an xml tag in the dtd ? > For example if I want to limit the size of a <name> tag to 50 is there a > method to do it in the dtd ? Do you mean the content of the name element? No, that's impossible with DTD. -- Johannes Koch In te domine speravi; non confundar in aeternum. (Te Deum, 4th cent.) "Jo...

Warning: size(CData) must equal size(ZData) or size(ZData)-1 for flat shading
I'll be honest, I have no clue why I got this error... I tried looking it up on the internet, but didn't find really anything that could help me :( Does anybody know what that error means? Warning: size(CData) must equal size(ZData) or size(ZData)-1 for flat shading If some portions of code could help, just ask for it ;-) grtz "Benoît " <devosbenoit@gmail.com> wrote in message news:j4hern$dbj$1@newscl01ah.mathworks.com... > I'll be honest, I have no clue why I got this error... > I tried looking it up on the internet, but didn't find r...

Code size as a function of source size
Hi, I would like to pose a very simple question, for which nevertheless I could not find an answer through google: Of what general type is the dependence of the size of compiled code to the size of the respective source code? Or to put it "mathematically", what function f(s) approximates the points (s, o(s)) best, where s is the size of the source code (say in bytes and normalized by removing commentaries and not using uncommonly long identifiers or amounts of white space) and o(s) is the size of the corresponding object code (without any libraries linked in). It seems natu...

sum of segment size and executable size
Hi, why I am getting different size value if i run "size" command and if i see using "ls -l" on an object file. my.c file contains only one empty function my.c f() { } The Output of size command on HPUX $ size my.o 8 + 0 + 0 = 8 ( here 8 is text segment size, rest is 0 ) $ ls -l my.o -rw-rw-r-- 1 odcqa1 users 696 Dec 30 11:41 my.o Can any one explain me? Why the size of my.o is larger than total of it's segment's size. -Sachin sachin_mzn@yahoo.com said the following, on 12/30/04 01:22: > Hi, > why I am getting different size value if i r...

how does size get passed into new( size ) ?
Q how does size get passed into new( size ) ....when we are creating object ? class Base { public: static void * operator new(size_t size); ... }; Base *p = new Base( ); // calls Base::operator new! Thanks pallav singh Pallav singh wrote: > Q how does size get passed into new( size ) ....when we are creating > object ? How does any argument get passed into a function? Sometimes it's in the stack, sometimes it's in a register. The language Standard does not mandate any particular way of passing the arguments. > class Base { > public: > static void ...

panel size vs. frame size
Hi, i'm writing a gui that has a main panel and includes 3 subpanels.. and has a Menu Bar.. i'm setting size of Frame with GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds() function. My screen Size is 1280 * 800 and because of Start button, it takes 1280 * 770.. its ok so far. you know the JFrame has a title bar. and suppose that i add a MenuBar to that JFrame. how can i measure the best size of main Panel and its bounds. i'm using null layout in main Panel and force the subpanels to main Panel but the X and Y values are not true. i think it shifts to d...

Image size & print size
I am trying to prepare some images for printing, and since I won't be doing the printing myself, I need to make them as easily used as possible when it comes to sizing and placement. Ideally, I'd like to create jpgs that are the right size for being printed out on A4 paper. They won't fill the whole A4, as their dimensions aren't right for that, but I'd like to be able to control the placement so that they end up nicely balanced. If I was doing the printing myself, I'd just pop into PSPs print layout, drop the image on the page and resize and arrange as necessar...

Adder size vs Register size
Hi, Hope you all are doing fine. I'm wondering about something. I know that in Xilinx FPGA architecture for every LUT, there is a Flip- flop available for storing the output of that LUT. This necessarily means that the area cost (in number of LUTs or slices) of for example an 8-bit unregistered adder or a registered adder is the same. Is that correct? Does it also mean that the area cost of an 8-bit register is the same as the cost of an 8-bit adder? I consider a carry ripple adder for which the area cost of the adder is proportional to the bit-width of the adder. Thanks beforehand for...

Natural size of explicitly-sized widget
Does anyone know if there is a way to find the natural size of an explicitly-sized widget, or to turn explicit sizing off for an existing widget? I use non-absolute explicit sizing to add space and get framed sub-bases to line up nicely, but the number of child widgets in some of these sub-bases can change due to user interaction. It may be possible to handle this by keeping track of the sizes of everything, including each child widget, but it would sure be easier if I could temporarily "turn off" explicit sizing and obtain the natural size. Then I could use for every change the s...