How to set the cell size in grid layout where each cell is a panel

Hi,
I am using a grid layout where each cell is a panel. Here I want to
set size of each panel to be equal irrespective of any. But it is not obliging the setSize().
no of row in grid - 4
no of columns - 4
each cell is a panel. each panel has a label.
panel.setSize(parent.getWidth(), parent.getWidth()/4); // not working. Size is adjusting to the length of the label.
I want to force the size of the panel to our preferred size.
Note: In swing we can use JPanel.setPreferredSize(). Unfortunately I cannot use Swing components. Requirement is awt only.
Any help in this is highly appreciated.
Thanks
Kishore

I observed it is same behavior with gridbag layout. Infact it is gridbag layout only with 4 cells, where first cell should be of constant width (it is base for other cell widths) and other cells are variable (some integer*base width of first cell). I want to set the size of first cell width to be constant.
Though it is redundant I once again say that it works perfect with setPreferredSize of JComponent.
But I should not use any swing component/api. This is sytem requirement.
Any help is appreciated.
Thanks
Kishore

Similar Messages

  • Hi, I am using Indesign CS6, How to set the page size in Inches.

    Hi, I am using Indesign CS6, How to set the page size in Inches.

    All fields in InDesign can be entered in any measurement system. So, if you want to make an 8"x10" document and go to File>New Document and the window looks like this:
    …you can type either 8 in or 8" into the Width field like this:
    …and when you move to the next field, it will convert the eight inches into the equivalent number in the unit of measure that it is using at the moment, like this:
    … (203.2 milimeters is the same as 8 inches). You can also enter a different measurement unit into other fields once the file is created, such as the width or height of a frame, or the position of an object in the X and Y coordinates.
    If you would rather just work in inches instead of having to type the inches mark or abbreviation, go to InDesign>Preferences>General and select the Units & Increments tab. There you will see Ruler Units for Horizontal and Vertical at the top of the window. Set them to Inches and all of the fields will display in inches. If you do that to an open document, you will change the unit of measure for that document. If you do it while no documents are open, it will change the unit of measure for any new documents you create. To change the unit of measure for existing documents, you will have to open each and make the change.

  • How to set the screen size with nested Iview screen

    Can someone show me how to set the screen size with nested IView  screen.
    at the moment i only try it with trial and error untill it looks somewhat close. Is there a property in VC to set the size for Height and width.
    The same question is for the form. the form elements inside the form is easy but the actual form is still a challenge.

    Hi,
    Yes you are correct ,Still the Form and iview are not able to change thier Layout Structure using a Propery.
    it is available with VC7.1
    Govindu

  • How to set the frame size?

    Hi,
    Can some one show me how to set the frame size in this program? History: I have created a window and added a button but its to small. So I want to increase the size of the frame to at least 600X400 pixel.
    private static void showGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("ButtonDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            Main newContentPane = new Main();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        }It would be nice if you could show me how to do it.
    Thank you very much for reading this.

    Challenger wrote:
    Simply adding
    frame.setSize(new Dimension(600,400));to the end of your code should work perfectly.Or, if you want to do it correctly, .setPreferredSize() on your frame before you .pack() it. The default layout manager for JFrame is BorderLayout, which uses the preferredSize of each component to calculate sizes during the .pack() call.

  • How to set the page size

    Hi,
    How to set the page size of a B tree node in berkeley db java edition?
    thanks.

    The two systems have different performance characteristics. If you are concerned with the performance characteristics, then the best way to tell is to benchmark them.
    By the way, both BDB and BDB JE are B-trees.

  • How to set the Font size of Label?????

    Hello everyone.
    I want to knoe how to set the Font size of the Label???
    Please help..
    Thanks a lot.
    Gloria

    Label myLabel = new Label("Hello World");
    //Font(String name, int style, int size)
    myLabel.setFont(new Font("Arial", Font.PLAIN, 12));

  • How to set the minimum size of the JDialog.

    Hi Could any one tell me ,
    How to set the minimmum size of the JDailog.
    I am using the JDialog's setMinimumSize(...)
    But it is not working.....
    Regards -
    Vikas Kumar sahu

    That's pretty much all there is, although you could always add a componentlistener and manually not let the size go below your minimum.
    Or you could try overriding setSize...

  • How to set the heap size of JVM

    please let me know that how to set the heap size of JVM

    C:\>java -X
        -Xmixed           mixed mode execution (default)
        -Xint             interpreted mode execution only
        -Xbootclasspath:<directories and zip/jar files separated by ;>
                          set search path for bootstrap classes and resources
        -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                          append to end of bootstrap class path
        -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                          prepend in front of bootstrap class path
        -Xnoclassgc       disable class garbage collection
        -Xincgc           enable incremental garbage collection
        -Xbatch           disable background compilation
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap size
        -Xss<size>        set java thread stack size
        -Xprof            output cpu profiling data
        -Xrunhprof[:help]|[:<option>=<value>, ...]
                          perform JVMPI heap, cpu, or monitor profiling
        -Xdebug           enable remote debugging
        -Xfuture          enable strictest checks, anticipating future default
        -Xrs              reduce use of OS signals by Java/VM (see documentation)look at the -Xm? lines
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap sizeThis can be used e.g. like this:java -Xms8M -Xmx32M MyProgwhich runs MyProg in a java VM with the initial heap size of 8 MB and a maximum heap size of 32 MB.
    - Marcus

  • How to set the fix size jframe window

    when I run the jframe ,the jframe window size is very small
    1)how to set the fix size jframe window??
    2)how to set the jframe cannot change the window size??
    thx~~

    1. You can set the size by calling JFrame's method setSize. There are two versions of this method: (1) setSize(int width, int height) and (2) setSize(Dimension d). Note, that when you use this method to set the frame size, you don't have to call JFrame's pack method.
    2. JFrame has a method called setResizable(boolean resizable) which you can call with the argument false.
    Without any ill intent, these questions are regarding something that is very easily answered by looking at the documentation for the JFrame class. I suggest to anyone working with swing to at least look briefly through the base classes they're extending before giving up. In my experience it is always more gratifying to figure things out on my own than asking someone. But please don't take this the wrong way, I respect people who seek out help in order to further their knowledge, instead of just giving up.

  • How to set the stack size for alchemy application?

    Anybody know how to set the stack size for alchemy application?
    If you know, please tell me how to adjust the stack size for alchemy application?

    Hi,
    The stack size is set as public const gstackSize in the alchemy generated code.  You can see this if you build with ACHACKS_TMPS set.  The default is one megabyte.
    One way to change the stack size is to use llvm-dis to disassemble avm2-libc/lib/avm2-libc.l.bc, generating avm2-libc.l.ll, modify the constant, and then use llvm-as to recompile your modified library and overwrite the old one.  These utilities should be in your path if alchemy is set up.

  • How to Set the Paper Size in Smart Forms

    Hi Friends,
                     I need to SET the Paper Size to default A4 in a smart form...and in some other case we need to set to other type 8.5 X 11...How can i set it....?

    Moving this discussion to the Scanning & OCR forum.

  • How to set the paper size when printing to postscript...

    I need help in setting the paper size in the PrintPreference when using either the Postcript File or Adobe PDF printer to generate ps files.
    Here's what I am doing (in c++) and I seem to be getting only 8.5x11 no matter the document page size:
    LPDISPATCH p_Dispatch = Document.DocumentPreferences();
    p_Dispatch = Document.DocumentPreferences();
    if(p_Dispatch)
    DocPreference docPreference(p_Dispatch);
    pgOrientation = (idPrintPageOrientation)docPreference.get_PageOrientation();
    pageW = docPreference.get_PageWidth();
    pageH = docPreference.get_PageHeight();
    paperSize = docPreference.get_PageSize();
    docPreference.ReleaseDispatch();
    p_Dispatch = Document.PrintPreferences();
    if (p_Dispatch)
    { PrintPreference printPreference(p_Dispatch)printPreference.SetPrinter(idPostscriptFile);
    printPreference.PrintFile(outfile);
    printPreference.SetPaperSize(paperSize ); /*I have also tried idCustom but it crashes with invalid parameter for the object type.*/
    printPreference.SetPaperWidth(pageW);
    printPreference.SetPaperHeight(pageH);
    VARIANT vprinterPresetType;
    vprinterPresetType.vt = VT_I4;
    vprinterPresetType.lVal = CInDesignApplication::idCustom;
    Document.PrintOut(FALSE, vprinterPresetType);....
    So how do i pas the document paper size to the print preset or preference?
    I appreciate your input.

    Moving this discussion to the Scanning & OCR forum.

  • How to set the Range size dynamically in an Iterator?

    Hi,
    One of my scenrio, i read the range size of Iterator and i performed the business logic validation. But in my case, range size is changed as per business requriement for a paricular Iterator.
    Is it possible to set the Range size property dynamically in an Iterator of pageDef File.
    I'm using JDeveloper 11.1.1.3.0
    Can anyone help me regarding this???
    Thanks & Regards,
    Perumal S

    Good afternoon,
    This works: f?p=1:#MYPAGENUMBERCOLUMN#::Session:Request:Debug:Clearcache:itemname:itemvalue:printerfreindly
    It works very well. I have been struggling for a couple of hours trying to figure out how to calculate the page number I wanted to link to from a report column defined as a linked item. I ended up modifying my VIEW to include the page number for that particular type of data and use this technique to jump to the correct page.
    Thanks for posting this. Nothing else seems to work.
    Don.

  • How to set the font size on only one object!

    I wonder how i could programmatically set the font size on only one object?
    Igor Stojčević

    Hello,
    You can use the builtin SRW.SET_FONT_SIZE
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/plsql/builtins/srw/srw_set_font_size.htm
    in the Format trigger
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/plsql/triggers/tr_format_trigger.htm
    Regards

  • How to set the fetch size for a ResultSet object?

    Connection con  = getConnection();
    Statement stmt = con.createConnection();
    ResultSet res = stmt.executeQuery("select * from table");
    //res.setFetchSize(?);
    while (res.next)
    res.get....
    }I do not know the number of rows .
    How can I set the fetch size for the ResultSet object?
    I try
    res.last();
    res.setFetchSize(res.getRow()/2);
    res.beforeFirst();
    while (res.next)
    res.get....
    }but it's so slow if there are 6000 rows.
    How can I set the fetch size for the ResultSet object more effectible?
    And what is the best number to set the fetch size?

    The fetch size defaults to a standard number. It is unlikely that it will be any faster if you set it unless you only plan to read a small number of rows.
    i.e. if you are going to read all the rows, you need to read all the rows no matter what.
    Unless the system has set the fetch size to 1 changing it will not be faster.
    Depending on the row length, reading in 6000 rows is going to take a long time. You could try using a cpu profiler to improve performance.
    Do you really need to read everything in every row?

Maybe you are looking for

  • Goods Receipt and Amoratization to Internal Orders (CO)

    Dear SAP Gurus - Please could you kindly assist in this matter. Our Production department is unable to upload the plan cost / unit cost to the 1st impression production order number, as stock was received before for the old title. Instead of creating

  • Do music files need to be available locally, even if on Match?

    Hi - I recently signed up to Itunes Match and successfully completed the sync and (pretty much) all my music was either matched or uploaded. All my music is stored on an external harddrive. Now that all my music is in the cloud I was hoping to be abl

  • How to append new rows in a table with Javascript ?

    Hi , I'd like to append new rows in a table dynamically using javascript? Do some of you have already done this before ?

  • SQL Practice

    Hello everyone. I have been using SQL for almost a year now and am currently studying for my 70-461 exam. I have the Microsoft training kit book, have read, highlighted, and done most of the exercises, however the best way for me to learn is just con

  • Canon .CTG files should not display in Photo Downloader

    Please make an option in Photo Downloader to exclude certain file types such at b Canon .CTG files which should not be downloaded. I would like a preference to exclude file types from being downloaded. Thank you.