Set specific size for JTextfield/Jbutton in BorderLayout?

can some one tell me how to set a specific size for JTextfield/JButton in Border/BoxLayout please?
I stried setSize, setPrefersize, setMAxsize, setMinsize, setBounds... but it won't work?
For example. If I add a jbutton to a jpanel, which has borderlayout, it will take up ALL the space in that jpanel.
Thanks

Typically you use a BorderLayout for the high level layout and then add panels using other layouts to the BorderLayout. So for example on a simple dialog that is using a form that asks your for your first name and last name you would build a panel with those fields and add that panel to the center of the BorderLayout. Then you would create another panel for the "Ok" and "Cancel" buttons which would typically use a FlowLayout. Then you add that panel to the South of the BorderLayout.
The Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use LayoutManagers has all the information you need to know on using layout managers.

Similar Messages

  • How to set fixed size for JTextField?????????

    you can create a textfield like
    JTextField text=new JTextField(8);
    here the constructor takes 8 as the width of textfield , not the size,
    if you type more the 8 characters, it takes it happily,
    i need that it only takes 8 characters, not more then that,
    after 8 character, the cursor should not move forward,
    can anybody help me???/

    Have a look at the following thread for an explanation:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=101704

  • How to set the size of JTextField (Pixels/characters)

    Hi,
    I'd like to determine a maximum size for JTextField, meaning the text field size is 15 characters only.
    I there a way to do that?
    Also..
    one more question..
    How do I set a specific Row not be editable?
    Many thanks!!

    in a class extending JTextField
    StringBuffer b = new StringBuffer();
    setColumns(0);
    for (int i = 0; i < width; i++) {
    if (isNumeric()) {
    b.append("0");
    else {
    b.append("m");
    setText(b.toString());
    setFont(new Font("Monospaced", Font.PLAIN, 12));
    setPreferredSize(getPreferredSize());

  • How to set the size for height of iView tray?

    Hi,
    I have created a ABAP webdynpro component and integrated this comp with iView. Then i integrated iView into Page in portal. That is working fine.
    But the size of tray/window which is displayed in the page is very small.
    How to increase the height of that Tray/window/iView containing my component?

    Hi,
    By changing the maximum automatic height and Minimum automatic height property of the iview you can set the size for height of your iview.
    to do this follow the setps:
    goto content administrator -> portal content -> your folder where you created your iview or directly to your iview -> right click -> open -> object,
    and now in property category choose appearance-Size from the drop down menu and set the above properties to your required height.
    if you want the end user to modify this property set the property to read/write .
    *********please reward points if the information is helpful to you********************

  • How to set percentage size for layout? for example : VBox,HBox,AnchorPane,.

    how to set percentage size for layout? for example : VBox,HBox,AnchorPane,......
    like HTML
    &lt;div width=&quot;640px&quot; height=&quot;480px&quot;&gt;
    &lt;div widht=&quot;50%&quot; height=&quot;60%&quot;/&gt;
    &lt;div widht=&quot;30%&quot; height=&quot;60%&quot;/&gt;
    &lt;div widht=&quot;20%&quot; height=&quot;60%&quot;/&gt;
    &lt;/div&gt;
    -----

    This is not supported. You can file a feature request at http://javafx-jira.kenai.com

  • Set height size for each state enabling browser scrollbar if needed..

    I'm working on a flex project, completely new to it. I'm trying to resize my application based on the set height size for each state. I'd like the wrapper to resize in the browser so that the  browser's scroll bar appears if needed. hope this makes sense....
    My enitial opening page I've set the height to 1000. now when I click on a link to another state from this page, we'll call it 'home' which i have set to 2000
    The page opens in its 2000 height but no scroll bar appears to scroll down in the browser...
    If anyone's done this or knows how to, I'd really appreciate your input.

    I've done something similar with a few of my apps, you have to use a little javascript on the html page and the ExternalInterface class in your app. Basically, you need to resize the "browser's" height based on your flash file.  So here's quick example:
    In your html template page (which you can edit in your flashbuilder project panel ->html-template->indext.template.html)
    in your html add the jscript function:
    <script type="text/javascript">
             function setWindowHeight(heightVal){
                 document.getElementById('theWindow').style.height=heightVal; // make sure to give the body tag an id of 'theWindow' or whatever
    </script>
    In your flashbuilder app you need to call the javascript fx, you can use the ExternalInterface class for this:
      ExternalInterface.call('setWindowHeight',val+'px');
    you need to send the jscript fx the height of your container or whatever you want it resized to....

  • How Can I set Specific RingTone for one person and general ringtone for all?

    Hello All,
    I have a problem with ringtone. I want to set specific ringtone for manager in my 99 series ip phone. Customer needs to know when manager calls him, that is why he told me that he wants to set specific ringtone for Manager.
    Thanks a lot
    Bahlul

    Hi Bahlul,
    I don't see such a feature on CUCM where you can have a separate ringtone for a Directory number based on the calling party number. Even to have separate ringtones for different lines on the same IP phone you need to play with Distinctiveringlist.xml , but that too does not fit your requirement as it will always be the same ringtone for all the calls on that line. You may probably get this feature through some third party solution but i am not sure if it would be worth it for applying it on one phone only.
    HTH
    Manish

  • Set Maximum size for a subpanel created with splitter bars in LV8

    Does anyone know how to set the Maximum size for a subpanel created with asplitter bar? If I show one cluster in the subpanel and use the scroll bar to scroll, I can see more (blank) area than I want. I just want the user to be able to scroll a cluster within a subpanel while the cluster is larger than the view area of the subpanel. I don't want to let the user scroll outside the cluster.
    Ravi Beniwal

    I apologize for the mixup in terminology. Please read Pane wherever the word Subpanel was used.
    Please see the attached VI for a description of my problem.
    I would really appreciate any help with this.
    Ravi Beniwal
    Attachments:
    Pane Scrolling Problem.vi ‏10 KB

  • How to set image size for importing photos from a digital camera

    I'm using Iphoto 6 and am a novice user of my new digital camera. The camera is set to HQ image quality. Initially when I imported photos from the camera into IPhoto, the images were very large (over 1 meg) and produced good quality 4X6 prints. Now when I import photos from the same camera still set to HQ image quality, the photos are very small (less than 100 kb) after being imported into IPhoto. I think I must have changed some kind of setting in IPhoto that affects the size of an imported image, but I can't find where that is or how to change it back so that the size is not changed when imported. Can someone please help me with this? Thanks!
    IMAC G5   Mac OS X (10.3.9)   my other computer is a Dell Dimension L500CX running Windows XP Pro

    Dave, thanks for clarifying Toad's response for me - I was just too ignorant to connect the dots from his responses. As you said, there were 2 versions - 1 in the original folder and 1 in data; the original folder had the photos that were 1 mb. We must have pulled from that folder previously to print photos not realizing they existed in 2 places. So when we found these thumbnail photos, we just thought they were the real thing. Where can you go to learn about the struction and hierarchy of the photos in terms of what Iphoto does to an image when you import it? Is it in Iphoto help somewhere? Thanks so much for your help with this, and you too Toad for leading me down the path.
    If you're getting the size from Finder, I think Old
    Toad's question makes a lot of sense. Is the file
    you're looking at, somewhere in a folder called
    "Data" in iPhoto Library? That 56k sounds about the
    right size for a thumbnail.
    If you do a search for the image name, both the
    actual photo and the small thumbnail are stored with
    the same image, e.g. abc.jpg
    IMAC G5   Mac OS X (10.3.9)   my other computer is a Dell Dimension L500CX running Windows XP Pro

  • How to set default size for published SWF in Catalyst CS5.5

    I create a 800*600 pixel project in Catalyst CS5.5 and published it as .swf.
    But when I opened the published .swf, the default size is smaller than 800*600. I have to resize it by myself.
    So is there any method that I can set the default size for published .swf?
    Thank you guys! Best regards.
    Nick

    When you start new Flash Catalyst project, you have the option to enable resizing
    This setting is enabled by default.
    If you need to change this later, you can go into Modify > Artboard settings.
    Now when you publish your project, the width and height will be used instead.
    As to manually editting the HTML file, there are 3 tag sets that define the width and height of the project (to handle various browsers). You will need to adjust the values in each of those tag sets. You should only need to do this if you can't republish the file.
    Chris

  • How to set output size for mp4?

    Hello,
    I'm having a problem with the export of a Captivate video tutorial.
    The output size is w 1440 x h 900 pixels. It comes out looking fine, but as soon as we put it through any other transcoding process as required by our own workflows, the image quality deteriorates.
    Now, I've read in this forum that any alteration of the size of the image will cause this deterioration in quality. Effectively, the dimensions of the transcoded output from our own video editors are much smaller than those of the input mp4.
    However, we would like to keep that smaller size because it makes for better performances in video streaming.
    Is there any way in Captivate to set the dimensions for the mp4 output to be smaller? The 1440 x 900 dimensions are already different from the capture area (the whole screen), so it seems they are independent from the capture settings.
    Thanks to anyone who can help.
    Elisa Roselli
    Technical Documentation Manager
    Cambridge Imaging Systems

    Apple no longer supports Safari for Windows  >  Apple apparently kills Windows PC support
    Use either IE or Chrome.

  • How to set fixed size for inputfile text field

    Hi all,
    I am using inputfile component to test file uploading so I created a simple upload page. When I finished upload the file, the input text field will "shrink" its size and change the size to adjust the file name. Is there any way to set a fix size for input text field?
    Here is some part of the code:
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1">
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>
    FileBean:
    public void fileUpdate(ValueChangeEvent valueChangeEvent) {
    RichInputFile inputFileComponent = (RichInputFile)valueChangeEvent.getComponent();
    UploadedFile newFile = (UploadedFile)valueChangeEvent.getNewValue();
    UploadedFile oldFile = (UploadedFile)valueChangeEvent.getOldValue();
    Thanks,
    Jerry

    you can set columns attribute in af:inputfile. Please see highlighted area i have inserted to you code
    <af:form id="f1" usesUpload="true">
    <af:panelHeader text="File Uploader" id="ph1" columns = "34" >
    <af:inputFile label="File to upload" id="if1" autoSubmit="true" valueChangeListener="#{fileBean.fileUpdate}"
    value="#{fileBean.file}" partialTriggers="if1"
    columns="50"/>
    </af:panelHeader>
    <af:commandButton text="Save" id="cb1"/>

  • Setting paper size for multi-tab numbers file?

    i have a (currently) 3 tab spreadsheet that someone is working with me on. two of the tabs i print to 12 x 18 and one of the tabs i print to 8 x11.
    right now i have to open inspector, set paper size to 8 x 11, go to print view and slider-scale to appropriate size so it will print to single width, open print dialog, select 8 x 11 printer, print the pages from this tab. then i go back to inspector, select 12 x 18, select next tab, go to print view and slider-scale to appropriate size so it will print to single width, open print dialog, select 12 x 18 printer, print the pages. then i select the next tab, go to print view and slider-scale to appropriate size so it will print to single width, and run a print to 12 x 18 paper.
    this gets me all three documents if i didn't make a mistake somewhere and forget to select the correct printer or open inspector or whatever.
    can someone tell me whether in numbers i can set a PAGE SIZE for a TAB (as i have done above) and have it stick or does the selection of a page size in numbers apply to the whole document? i keep sending this to my bookkeeper and getting it back and this is a whole lot of aggravation that is really messing up my workflow and there seems like i should be able to find a way to streamline this.
    note: i am actually /receiving/ xls from my bookkeeper (and exporting to xls when i send it to her) and we also need to keep the tabs together b/c one tab is pulling info from the others but i am wondering if there could be some kind of workaround.
    i'd like to ask her to just print the pages to pdf before she sends it to me but this is an added layer of work on her end that is not going to happen. also, i /can/ open in excel (i have excel for the mac) so if this works easier by printing from excel i will do that.
    any experience with this issue would be greatly appreciated.
    THANKS

    hi Y. BIG time thank you for this. i was not aware this was such an issue. i definitely cannot have any ambiguities in my spreadsheet and customizing it in numbers is the whole reason i am spending this time formatting (i.e. to make it intuitive and visual).
    that said, if accepting excel and then exporting to excel will cause problems i absolutely cannot have this.
    can you help me a little more on what the problems are? i have already got a file with two tabs directly imported from Quickbooks (by my book keeper in excel) and a tab that she set up that pulls data from these tabs - and then i have MY tab that i have been customizing and proofing and fixing as i go along. more info on this work below.
    are there commands i can run to clean this up?
    what is considered OK to do in numbers if i am accepting excel (printing? adding new numerical entries)?
    THANK YOU
    background: right now i am /mostly/ doing formatting things like adding bold outlines or adding color or whatever but i have /also/ been dragging and dropping some rows to put them in a better place and fixing some cell sums that were either left out by my book keeper or which needed to be added to check THEIR work. are you saying that by doing this i am setting myself up for various formatting issues such as merged cells?
    if so, once i finish the format of the spreadsheet and the tabs i can only exclusively open in numbers if this is necessary. are there some commands i can run to "clean up" issues? for instance can i go around the various tabs and unmerge cells to clean things up?
    also, i definitely cannot split up tabs into individual documents as the customized spreadsheets are pulling numbers from a set of tabs that are quickbooks imports....

  • Set font size for ChoiceGroup

    Hi,
    Is there any way to set font size of the String elements of ChoiceGroup

    Hi,
    Yes, there is, but only if you're using MIDP2.0.
    Check the API documentation of ChoiceGroup and see that there's a setFont(.., ..) method. The given index (int value) identifies the index of the element in the list for which the font will be set. This means that different elements in one choicegroup can have different fonts.
    Test it carefully, I've noticed that not all devices show correct behaviour on this. Also note that certain devices ignore certain font settings (for example italics, because a lot of native implementations won't have a font in italics).
    Good luck!

  • Set paper size for image on roll paper

    Q     I am trying to set the paper size for a H 30cm x W 80cm image using roll paper on an Epson R3000 printer. Computer Dell I7 64b and using Elements 9. Thank-you, John

    Garry - Many thanks for the reply. I was following the usual routine but I had never needed to use the 'User defined' box previously but it appears this is vital to the whole process when using roll-paper. I also found that the paper height becomes the Length when using roll-paper. I nearly entered the paper height (as requested) as 10m (length of roll) but you need to enter the length of the actual print required or the print process will start in the middle of the 10m roll! always seems to be that little extra missing from the manuals!  John

Maybe you are looking for

  • How to make a "return delivery" from a goods mvnt  linked to a reservation

    Hi, I want to realize a "return delivery" from a goods mvnt that is linked to a reservation number. I'm using FM BAPI_GOODSMVT_CREATE. I'm able to create a goods mvnt, but this doesn't updates the quantity in the reservation document. For example: Th

  • FCPX(10.1.1) quits when I load library

    Every time I try to load a library FCPX quits. It's just this one. I have it on an external drive. Have tried moving the library do another drive, but same problem there. It quits when it's loading curves(Natress). Have downloaded Event Manager X, bu

  • Setting ResultSet CONCUR_UPDATABLE

    In SaveLoad class I make a connection to my mysql server; by "jdbc:mysql://195.1.215.170:1433/inventory_mapping" then I create a Statement; DB_Statement = DB_Connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); af

  • Lumia 620: Reset error, Stuck on gears screen

    Yeah. I tried to do the Amber update on my phone, but it restarted during the update and it said I didn't have enough space for the update because it wanted to redownload the files rather than use the ones already there. I couldn't clear any more spa

  • Cannot create blank projects at 1280x720 or above on 10.8.4 Mac OSX.

    Every time I create a blank project at these specifications, Captivate stops responding and gives me a perpetual loading symbol. I can't begin to think how to fix this, but it is fairly important that I get this to work somehow. I'm working on a Mac