Set size of GridLayout item

Is there any way to set the size of a particular GridLayout item? These are my items...
buttonPanel.setLayout(new GridLayout(4,0));
buttonPanel.add(placeBid);
buttonPanel.add(checkStatus);
buttonPanel.add(quit);
buttonPanel.add(imageShow);
I would prefer imageShow to be about twice as big as the other three items.
Darrell

Please reread the API documentation for GridLayout:
You cannot do this with GridLayout. Use FlowLayout or GridBagLayout or SpringLayout instead.

Similar Messages

  • Setting size in GridLayout

    Hi everybody,
    I have a main window with a main panel in it, and the window contains a JTextPane, added first, and then a JScrollPane, added second, in a GridLayout with one row. So, the JTextPane is on the left and the JScrollPane is on the right, and they're both the same size. (I hope that was clear). My program works fine, it's just the concept of sizing that's confusing me.
    I'd like to make the JTextPane twice as wide as the JScrollPane. When I add these two to the GridLayout, though, they're both the same size, whether or not I try to set a size or preferred size. Can anyone explain to me in general terms how to make those two components have different sizes? I have a feeling it might have something to do with GridBagLayout instead, but I've looked at the javadoc multiple times and I don't understand it.
    Would anyone mind explaining to me how to solve my problem, please, and giving me a general example?
    Thanks,
    Jezzica85

    GridLayout can only size components the same. I know of no way around this. GridBagLayout may work, although as a rule I try to avoid this if possible, and often there are other ways of sizing things, for instance by nesting JPanels each with different layouts. My advice is to go to the layout tutorials and play with the different layouts. The only way to learn them is through experimentation. Good luck.

  • Set size of jPanel

    Hi i've create a jForm in netbeans. To this I have added a scrollpane containing a jPanel called PrintPreview. (I have to do this rather than use the automated preview of printUtilities because of some items I need removed from the original jPanel before printing).
    I need to set the size of the PrintPreview jPanel as it's instantiated. I have the dimensions created from another class called "Gbl".
    In the constructor is the following:
    /** Creates new form PrintPreview */
    public PrintPreview() {
    PreviewPanel.setPreferredSize(new Dimension(Gbl.previewWidth,Gbl.previewHeight);
    PreviewPanel.setMaximumSize(new Dimension(Gbl.previewWidth,Gbl.previewHeight);
    PreviewPanel.setMinimumSize(new Dimension(Gbl.previewWidth,Gbl.previewHeight);
    Window.pack();
    initComponents();
    this.setLocationRelativeTo(null);
    // ADD CODE - COLLECT DRAWING FROM ARRAY
    PreviewPanel.repaint();
    I would like the jPanel set to these dimensions however I would also like the scrollPane to remain at it's standard size so I can scroll the diagram as necessary.
    Could you please tell me where I am going wrong? The three setSize lines are flagged as erroneous. The dimensions are int and have tried double.
    Any advice is good...
    Thanks

    Ok I'm going to add onto this thread because it still relates to the original problem. setting size of jPanel.
    Some details first:
    OS - Ubuntu Gutsy 7.10
    Kernel - 2.6.22-14-generic
    NB - v5.5.1
    Java version - java version "1.5.0" / gij (GNU libgcj) version 4.2.1 (Ubuntu 4.2.1-5ubuntu5)
    Research:
    I have been trawling the net for days trying to resolve this but I am struggling to find anything specific to my problem. I keep finding general methods using given NB facilities. I've also scoured a couple of my Java books but of course they're not totally relevant to NetBeans. I've practiced using the forum this afternoon to find things but with my lack of knowledge using both forums and java has left me a little bamboozled. I've been working on this problem for a couple of days now and achieved very little.
    My specific problem is this:
    I have a JFrame GUI. Inside that I have a jTabbedPane containing a jScrollPane containing a jPanel. I would like to have the jPanel display at A4 size relevant to the screen it is displayed on. e.g. I have a separate global class "Gbl" that calculates the dimensions based on current dpi and then creates the necessary measurements to feed to my preferred size function.
    I have tried implementing the preferred size method to the constructor and have also tried adding it to all four ways to enter bespoke code to NetBeans' autogenerated code. (Pre-init, Post-init, Pre-creation and Post-creation code) To no avail. Nothing changes on screen.
    The code I am trying to enter is as follows:
    // Set preferred size of user-drawing-area (jPanel1)
    jPanel1.setPreferredSize(new java.awt.Dimension(600,500));
    jPanel1.setMaximumSize(new java.awt.Dimension(600,500));
    jPanel1.setMinimumSize(new java.awt.Dimension(600,500));
    // Set preferred size of jPanel1 container (jScrollPane1)
    jScrollPane1.setPreferredSize(new java.awt.Dimension(600,500));
    jScrollPane1.setMaximumSize(new java.awt.Dimension(600,500));
    jScrollPane1.setMinimumSize(new java.awt.Dimension(600,500));
    // Set preferred size of the jScrollPane1 container (mainTabView(Tabbed pane))
    mainTabView.setPreferredSize(new java.awt.Dimension(600,500));
    mainTabView.setMaximumSize(new java.awt.Dimension(600,500));
    mainTabView.setMinimumSize(new java.awt.Dimension(600,500));
    I am using absolute values here to omit any error getting the variables from my Global class. If it works I will add them and test again.
    Ideally, I would like the jPanel to be set to an A4 size yet have the containers at a smaller more "screen-manageable" size (With scroll bars). Then if the GUI is maximized, then it only expands to the full size of the A4 sized jPanel if possible.
    Of course, this may not be possible or there may be a far better method for doing this, however I am really stumped. I've had some good advice this afternoon of whihc has opened may eyes some. Although, I have made no headway so far. I hope the above follows site-rules and gives enough information to resolve this issue. I'm losing hair rapidly!
    I'm grateful for any advice given. Thank You

  • Essbase Error:Set is too large to be processed. Set size exceeds 2^64 tuple

    Hi,
    we are using obiee 11.1.1.6 version with essbase 9.3.3 as a data source . when I try to run a report in obiee, I am getting the below error :
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 96002] Essbase Error: Internal error: Set is too large to be processed. Set size exceeds 2^64 tuples (HY000)
    but if I run the same query in excel add in, I am just getting 20 records . wondering why I am getting this error in obiee . Does any one encountered the same issue ?
    Thanks In advance,

    Well if you want to export in I think you have to manually do it.
    The workaround it to open your aperture library by right clicking it and show contents...
    Then go into your project right click show contents...
    In here there are sub folders on dates that the pictures were added to those projects. If you open the sub folder and search for your pictures name it should be in that main folder.
    You can just copy it out as you would any normal file to any other location.
    Voila you have manually exported out your file.
    There is a very similar post that has been close but again you can't export the original file that you are working on - FYI http://discussions.apple.com/thread.jspa?threadID=2075419

  • Mapping in BPM - set value of collection item

    Hello,
    is it possible to set value to exact item of collection in mapping step in netweaver BPM?
    I need something like set(<collection_variable>,<item_index>,<item_value>)  - so exact opposite of GET generic function, which gets specific item from collection.
    Is it possible in NW BPM?

    You dont have to apologize. I didnt meant that as offend.
    I appreciate the possibility to discuss that topic with somebody, because discussion itself sometimes shows other perspective to the problem, which can lead to solution
    Of course I wrote EJB function to solve that - but I cant believe that it isnt standard solution to that pretty common use case.
    I think, that problem lays in very limited implementation of XPath into Netweaver BPM. I will bet my left hand, that in some future SP of BPM will SAP introduce something like this:
    myCollection[1]/notificationId = notificationId
    which is standard XPath way to do that

  • How to use "Reference Structure" setting in analysis grid item

    Hello expert,
            in Bex analyzer, how to use "Reference Structure" setting in analysis grid item by example?
    Many thanks,

    The variable needs assigned a value, that's why you're getting prompted. When you execute the statement, it's not executing the variable and exec lines.
    Having script output available in a grid would be an enhancement request.

  • How i can set size of editor at runtime?

    dear all,
    How i can set size of editor at runtime?
    The size of editor is good when I run form on windowX but so small on web . why? have any body call tell me how i can do?
    thank for advance

    Hi there,
    You can use the builtin EDIT_TEXTITEM.
    You can pass x-pos, y-pos, width and height as parameters to that.
    Hope this helps

  • Setting custom table attribute set value in region item table

    Dear all
    I am working on oracle application customization and extension in
    oracle JDeveloper R12. I am finding a difficulty in an query region of
    a OA framework page
    My Entity object is on the table FWK_TBX_ADDRESS table
    and VO objects has the fields or columns
    AddressName, AddreessId, TownC-OrCity
    what I am doing shown in the following steps
    1-I select region using wizard option
    2-select my AM and VO
    3-select table as style
    4-shuttle all attributes associated with VO
    5-in region items table , select the Attribute set field for AddressName attribute and click the serach flashligh icon
    6-After that select the browse button , using the package browser , expand down to oracle > apps > fnd> framwork > toolbox > attributesets, then oK
    7-select the serach control , and then it list all the attributes set related to fwkTbxEmployees table like the following
    /oracle/apps/fnd/framewok/toolbox/attributesset/FwkTbxAddress/AddressName
    Now the problem which I am facing now is that if I have custom table suppose "xxEmployees" and have attributes or column
    for example employeeId, employee_name, email etc. what would I do to search these attributes when I come to step number 6 which
    I mentioned above. from where in which package I can find these attributes to set attributesset value. in above i find these attributes
    in /oracle/apps/fnd/framewok/toolbox/attributesset/FwkTbxAddress/AddressName
    but in my case for attribute lie employeeId or employee_name from where I can get this how can I set the value of attribute set field in regin item
    table in step 5
    Noman

    I dont know what u trying to ask
    My problem is just that I want to set the attribute set value of my attribute employee_name, same is AddressId in fwk_tbx_address
    ame is AddressId in fwk_tbx_address found on
    /oracle/apps/fnd/framewok/toolbox/attributesset/FwkTbxAddress/AddressName
    where can I find my attribute employee_name
    in jdeveloper

  • Circular and oval cropping at set size and resolution?

    I know how to use the M tool to create circles and ovals and i know you can set that to certain dimensions, but that doesn't do everything I need.
    How do you crop circles and ovals out of a photo, at a set size (for example, a 1 inch circle ) at a set resolution for printing?  What I need to do is crop circular and oval images out of a photo, say at 250 dpi, then paste them onto a blank white page for printing.
    So if I've got let's say a photo that's 14x10 inches at 300dpi, I want to be able to go in, crop out an oval or circle, with as much or as little of the photo that I can or want to, setting that automatically to a certain dimension and dpi, then paste it into a blank white page I've already created at that same d
    When finished I'd have maybe 20 or 30 images on a page that I can flatten all the layers and print.
    I can't find a way to set size and resolution with anything other than the regular square crop tool.

    You can make an action and use it as one step automation to achieve that on an initial selection.
    Step by step instructions:
    With the Elliptical Marquee Tool, make the desired selection on a image.
    Open the Actions panel (Window > Actions (Alt+F9), from its menu at the top right or corresponding buttons at the bottom, choose New Action, and in the dialog that appears press the Record button.
    From the Image menu, choose Crop.
    From the Selection menu, choose Inverse (Ctrl+Shift+I)
    Press the d key on your keyboard to reset the foreground/background color swatches.
    Press Ctrl + Delete keys on your keyboard to fill with white.
    From the Image menu, choose Image Size (Ctrl+Alt+I), make sure the Resample Image is checked, and in the Document Size section enter the desired dimensions and resolution and press OK.
    In the Actions Panel press the Stop Recording button.
    Now you can copy or drag the image to another image.
    For the next image make the oval selection, go to the Actions panel, select the actions you created above, and press the play button. You can also create a keyboard shortcut in the action's property accessible by double clicking the action.
    The creation of this action assumes that in the final image you will be composing oval images on white background without overlapping their rectangular bounding boxes. If you plan to overlap them then the action must be modified to make the image a transparent layer and delete outside the oval instead of filling with white.

  • Record set size in Gantt Chart

    Hi all,
    I am developing an application that has a Gantt Chart.
    The tree drawn is a 2 level tree. I have two VOs.
    The second VO (Child) has more than 20 rows. I want to show only 10 child at once.
    Record set size attribute is the one that is used to restrict the size of the number of nodes displayed. Just like in HGRID.
    But when the graph is rendered the values that I give are being ignored and the entire graph is rendered.
    Any pointers or suggestions on this will be really helpful.
    Regards,
    Santhosh.

    Hi Santosh,
    As Anand suggested to add the "rownum <= 10" condition to limit the record set.
    But this condition should be set in View Link SQL(Query where clause).
    I hope this will work.
    Thanks
    Renu

  • How programmatically set size of report element in Java

    In topic
    [How programmaticaly set size of some field?|How programmaticaly set size of some field?]
    someone changing programmatically report element, but I think this part of code
    is in .NET framework
    For example I mean something like following snippet
    BoxObject box = (BoxObject) reportClientDocument
    .getReportDefController().findObjectByName("headerBox");
    BoxObject newBoxObject=new BoxObject(box);
    Border border=new Border();
    border.setBorderColor(new Color(255,255,255));
    newBoxObject.setBorder(border);
    newBoxObject.setFillColor(new Color(255,255,255));
    reportClientDocument
    .getReportDefController().getReportObjectController().modify(box, newBoxObject);
    Why I think this is in .NET framework because java object "ReportClientDocument" don't have "getReportDefController()" method (I donu2019t know .NET).
    What I want to do, I want to take "Details" (part of report) and change size.
    If there is no way to take "Details" how can I take other report element e.g. Text Object

    Ernest,
    What enviroment are you working in? Because my ReportClientDocument object does have the getReportDefController method. How are you declaring your object?
    Try something like:
    private static com.crystaldecisions.sdk.occa.report.application.ReportClientDocument myRCD;
    BoxObject box = (BoxObject) myRCD.getReportDefController().findObjectByName("headerBox");
    Cheers
    Darren

  • Addition of field in personal setting-default value-po item

    Hi,
    can any one tell me how to incorporate following senario while executing  me21n tcode
    I want to add  a new field “Shipping Instructions” EKPO-EVERS in the personal setting – Default Value – PO Item.
    please tell me the steps to do so
    thanks

    Hi
    please refer to this
    <b>New tabs in the header tab-sheet of ME21N/ME22N/ME23N

  • Setting an app level item based on :APP_USER

    I am trying to set an application level item right after I log in and I want the value to be based on the setting of :APP_USER. I created an application level process at the "On New Session: After Authentication" point containing the following code:
    select id into :F107_VOTER
    from el_person
    where userid = :APP_USER;
    This works fine when I run the page from the builder, but fails when I fire up a separate browser session and access the app directly. I'm suspicious that perhaps APP_USER built in item is not defined when the process point runs. Can someone confirm when APP_USER is set relative to this application level process point and/or perhaps suggest an alternative way to initialize an application level item that is dependent on APP_USER?

    Bill,
    The first page that runs in your new session is the login page. So your process runs at the very first opportunity (On New Session:After Authentication) when APP_USER is null, which doesn't do what you want. The name of that process point is misleading, it means after authentication for the current page. For the login page, which is necessarily a public page, the authentication steps are completed immediately after the show processing begins. So then you enter username/password and submit the login page which takes you to the first real page in the app, but still in that same session, but the process has already fired and won't run again.
    I suggest that you create another application item, F107_VOTER_INITIALIZED, change the process point to be Before Header, add a condition so that it runs only if F107_VOTER_INITIALIZED is null, then have the process run the query and set the initialization flag to a non-null value. Of course F107_VOTER itself can be the initialization flag if it is to remain constant throughout the session.
    Scott

  • Make it open at set size?

    Is it possible to make the QT player open pre-existing files at a set size?
    Thanks.

    Hi, Rick
    It's possible.
    You can either use SimpleMovieX or QuickTime Pro.
    (Note that I'm the developer of SimpleMovieX).
    If you accept to create a separate file, you resize the movie with View > Resize Movie, then save a reference movie with File > Save RefMovie.
    The new file takes only a few kilobytes and links to the original. It opens at the size that you have set.
    If you want to keep the same file as original, it has to be a QuickTime mov file.
    You do View > Resize Movie, then File > Save.
    If you cannot or don't want to overwrite the original size, then it's not possible.
    Regards, BJ

  • Set size and location of  a component

    Hello,
    Does anyone familiar with this org.netbeans.lib.awtexttra.AbsoluteConstraints(). I want to set the size and location of the component, and I know this org netbeans can provide this function.
    getContentPane().add(chkTausta, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, -1, -1));
    chkRakkennus.setSelected(true);
    chkRakkennus.setText("Rakennukset");
    then it comes an error that org.netbeans.lib.awtextra.AbsoluteConstraints()cannot be resolved. Does anyone know what�s the reason. Do I have to download other version of Java. I have Jre1.6.0?
    Does anybody knows is there another way to set size of component. For example, if I use borderlayout, and put a button to the west, then how can I set the location and size of the button?
    Thanks a lot for you help.
    Clare

    org.netbeans.lib.awtextra.AbsoluteConstraints isn't part of the JDK. I suggest you don't use that at all. Let a LayoutManager do the resizing.
    Have a look at the [Layout tutorial|http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html] especially gridBagLayout

Maybe you are looking for

  • Web Service Support

    Hi, I was wondering if the web service wsdl import and class generation supports all the different types of encodings (RPC, Document Literal,etc..). I am getting a null being returned...I was wondering if there is a way to get the actual soap respons

  • Please tell me how to disable Top Hits in Safari

    iPhone 4S. Just upgraded to iOS8. I noticed Top Hits popping up when I start a search. Never saw it before. Very annoying. I've tried turning everything off under settings>safari>search. I also tried turning on "safari" in iCloud and then "merge" fol

  • OT: .htaccess files on a Mac

    Can anyone tell me what steps you followed to get .htaccess files with mod-rewrite rules to work on a Mac? I'm using the MAMP package, but I decided to stick with Apple's default Apache installation, since my virtual hosts work with it but not with M

  • My iMessage won't work on my iPhone 4.

    My iMessage won't work on my iPhone 4. It used to but I had a new screen and a new apple ID created so I don't know which is causing the issue. I tried turning off auto time and back on and still won't work. It say check connection. Same with happens

  • Messages App says address is unverified?

    I just updated to Mavericks, and I was pretty pumped to get it because of the messages app. (I was on OSX Lion earlier) I tried signing in with my normal Apple iD and it says it's unverified. I've been using this Apple iD for my iPhone and anything A