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

2 Replies
286 Views

Similar Articles

[PageSpeed] 42


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

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

Finding the size of a dynamically sized input
If I have an input that is dynamically sized: ssSetInputPortWidth(S, 0, DYNAMICALLY_SIZED); and during runtime I would like to know the actual sizes that were computed (row and column) so that I can use them as limits for loop operations, so what I don't know is what is the syntax to find the row and column dimensions of a dynamically sized input? Thanks, Matt ...

File Size
Not a terrbily accomplished C coder here. I have a small ANSI C app that at some point needs to know the number of bytes in a file. I've seen a few suggestions along the lines of: fseek(fIn, 0, SEEK_END); fSize = ftell(fIn); Which worked great until now. We have now come across a situation where the file is huge (one specific example is 4,499,692,752 bytes). Even if fSize is declared as "long long", which is big enough to handle that value, it is not geting the correct value. So that tells me that either fseek can't get that far into the file or ftell can'...

SIZE giving wrong array size?
Hi, please consider the following code snippets, where ndim,nx,ny,nz,nb are passed to the subroutine in which it appears as parameters and nxtot,nytot,nztot,nbtot via a module: real, intent(in) :: a(ndim,-1:nx,-1:ny,-1:nz,nb) real, allocatable :: atot(:,:,:,:,:) allocate(atot(ndim,0:nxtot-1,0:nytot-1,0:nztot-1,nbtot)) write(*,*) size(atot),size(a),ndim,nxtot,nytot,nztot,nbtot,nx,ny,nz,nb When running the program on one processor, this returns 65536 200460 1 1 512 128 1 1 512 128 1 i.e. ndim,nxtot,nyto...

adjusting figure size and colorbar size
Hello Everyone, My tick mark labels at the colorbar are very long, the figure that shows up would not be big enough to show the labels. Only half of the labels are shown on figure, and the rest is cut off. I tried to adjust the figure size by pos1=[355 499 600 511] set(h,'OuterPosition',pos1) But then I notice that would only change the overall size of the figure. In other words, if I change the width parameter, my plot would be widen, but not the colorbar region. So the colorbar labels are still cut off. So I want to change the width of the colorbar tickmark label'...

Re size with correct print size
I would like to resize a photo to say for example 8x10, if I do this without keeping aspect ratio, the picture size is squashed. In Photoshop you can drag the image over the 8x10 box. Can I do similar with PSP9 ? "jerham" <jerrham@pobox.com> wrote in message news:r7Oye.16945$pa3.9015@newsread2.news.atl.earthlink.net... >I would like to resize a photo to say for example 8x10, if I do this >without keeping aspect ratio, the picture size is squashed. > > In Photoshop you can drag the image over the 8x10 box. > > Can I do similar with PSP9 ? Yes you can us...

Window size to adjust to content size
For reasons I won't go into I'm popping up windows with a standard routine for many different forms. The window I pop open is hard coded to a certain size. Some of the windows are too small for their content, some too big depending on the size of the form. Is there a way, once I'm inside the popup window and after it is displaying it's contents, to determin the width and height of the form within the window? If I put a named <div> around it could I then access theses dimensions? I know how to make the window resize itself, just not sure how to determine the new size. Than...