How can I add a normal-sized button to my frame???

hi,
my GUI has two JScrollPane-s together in a JSplitPane and below I'd like to add a single small button.
I put this button into a new JPanel, but it is displayed veeery BIG !
I tried to use .setPreferredSize(new Dimension(int, int)), but it didn't help a lot.
this is a piece of my code:
public class MyTree extends JPanel implements TreeSelectionListener, ActionListener {
          this.setLayout(new GridLayout(2,0));
         buttonUpdateM_File = new JButton("Update the .m file");
         buttonUpdateM_File.addActionListener(this);
         JPanel actionPane = new JPanel(new GridLayout(0,1));
         actionPane.setMaximumSize(new Dimension(1,2));
         actionPane.setPreferredSize(new Dimension(5,10));
         actionPane.add(buttonUpdateM_File);
          //create the scroll pane and put the tree into it
          JScrollPane treeView = new JScrollPane(tree);
          //create the viewing scroll pane
          JScrollPane maskViewPane = new JScrollPane();
          //add the two scroll panes to a split pane
          JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
          splitPane.setLeftComponent(treeView);
          splitPane.setRightComponent(maskViewPane);
          Dimension minimumSize = new Dimension(420, 360);
          treeView.setMinimumSize(minimumSize);
          maskViewPane.setMinimumSize(minimumSize);
          splitPane.setDividerLocation(210);
        splitPane.setPreferredSize(new Dimension(600, 510));
        //Add the split pane to this panel
        add(splitPane);
        add(actionPane);
     }Thank you!

thanks,
as far as I understood there is no way to shrink the
new JPanel with this GridLayout.Yes, Grid just makes a set of fixed sized boxes. If you want the JPanel to be the same size as the JButton, what do you want the panel for?

Similar Messages

  • How can i add a donate now button to my iweb website

    how can i add a donate now button to my iweb website

    Here's some info about PayPal buttons....
    http://www.iwebformusicians.com/Internet-Music-Sell-Distribute/PayPal.html
    A "Donate" button is created in the same way as a "Buy" button.

  • How can I add a Save form button ( not save as ) for a custom fillable form ?

    How can I add a Save button ( not save as ) for a custom fillable form ?
    idea is ti to have a Save button  at the bottom of each page where the person filling
    the form  clicks the save button  on each page.( it is a 12 page fillable form )
    The only thing I was able to do  was add a button that  opens a Save As
    dialog box only.
    My experience  lever is - end user-intermediate.
    Thnaks.

    Thanks for the response.
    I wonder why  it wont allow.
    If I can  save ( as opposed to save as)   this form by clicking the  save icon on the  menu bar, I am not sure why it is no possible to do so on page level!
    Custom script option is not  even remotely possible!

  • How can I add a Smart object (button) to a quiz background and have it work?

    Good day,
    I have the need to add button to a quiz (in Captivate 6) to allow people to leave the quiz and go back to the start page.
    I realize you cant add a normal button to quiz, so I added a smart object converted to a button on the master page.  I have it all set up to go to the page, mouse over shows hand and all of that.
    the Captivate runs, I get to the quiz, mouse over it changes to a hand.  I click and it does nothing.  Any ideas why??  Any suggestions on how to do what I want?
    Thank you
    Dave Stabley

    Hi Lilybiri,
    I always look to your blog for help.   This time unfortunately it didnt help me.
    as I expressed above all I am trying to do is create a button that will do a jump to page with in a quiz.
    I have some long quizes in the captivate projects that I create.   Once a person starts a quiz they might realize it is a bit more than they are ready for.  I am just trying to give them a way to click a buttong to get out of the quiz and back to a certain page.
    On the master page for the quiz, I created a smart object (rectangle) that is converted to a button it is also transparent and goes over top of a graphic for the button.
    I tell it to go to the correct page, and I set it up so that when you mouse over the smart object it shows a hand
    When I go to preview this, I mouse over the graphic and get the hand icon, but when I click it goes no where.  It seems to me that the quiz is waitting for an answer before it will accept the click.   The catch is when I give the answer it forgets click and moves on the the next question.
    Any thoughts?
    Thank you

  • How can I add a facebook "like" button to my website?

    I just got the like botton code from facebook developer, but don't know where to drop it in iWeb. I would like the like button to appear in the contact page of my website: gingerbirdstore.com
    Please help to get this working.
    Thank you

    add the following into html snippet and click apply button:
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    <div class="fb-like" data-href="https://www.facebook.com/gingerbirstore" data-send="true" data-width="450" data-show-faces="true"></div>

  • How can i add a buy now button using any pmt. gateway provider. I cannot use Paypal. I will lose too much business. Old dogs don't like new tricks.......

    i am creating a site for a carnival. I need people of wealth to buy tickets to the event. they don't even know what paypal is and will not go through the trouble of setting up an account. I just want to be able to uses an outside payment gateway. I am so new to site building please speak is simple terms. I'man old dog trying to learn a new trick...Any help would be almost worshiped at this point...LOL

    Provide the name of the program you are using so a Moderator may move this message to the correct program forum
    This Cloud forum is not about help with program problems... a program would be Photoshop or Lighroom or Muse or ???

  • How do you add a Facebook like button to an iBooks Author page?

    How can I add a Facebook Like Button to an iBooks Author page?
    I've got my book ready to go.
    I've got a facebook account to promote it.
    I just want to add a "Like" button on the iBooks page.
    regards
    iRevDr Bill Wall

    Hi KT,
    That was helpful, but I'm still having problems.
    I've plonked a Facebook logo on the page.
    BUT I can't seem to give it a hyperlink to my Facebook page.
    When I select the logo and then use the tool bars or the box thingy. It won't allow me to paste in the URL.
    It looks a bit ugly having a Facebook logo and the text of the URL beside it.
    Is there a way of making the Facebook logo have a hyperlink to its URL so you just click on the logo and it takes you to the facebook page.
    regards
    iRevDr

  • How can I add a review button on my podcast

    How can I add a review button on my podcast, so I can see it on my iphone or itouch?

    You must create a custom signature.
    Find a guide here

  • How can i add hardware button control

    dear
    sir/madam
    i am using htc explorer mobile smart phone and port the Firefox OS to my mobile its working fine and not pick upping the network for Sim card always searching for network and home key only working how can i add menu,back and search buttons to hardware controls file please help me and video also crashed help me and Bluetooth, Wi-Fi ,GPS,Sensor,sound are working well please help me to fix the abow problems Thank you sorry for my bad English

    Hi,
    Sorry for the late reply, I don't know the answer to your question about hardware button control. But, some developer questions are being asked & answered here:
    http://stackoverflow.com/questions/tagged/firefox-os
    Maybe you can find a developer there who can help you out?
    Thanks for porting Firefox OS!!
    Regards,
    Michelle Luna

  • How can i add Facebook likes button on my mac mail?

    How can i add Facebook likes button on my mac mail?

    You must create a custom signature.
    Find a guide here

  • HT201436 There is no +, close to my contact button...How can i add contacts to my i phone?

    There is no + button close to the contact button. How can i add contacts to mu i-phone 4S?

    Hi Friend,
    Check if you turned Restrictions on before, in Settings>>General>>Restrictions.
    Hope it helps

  • I have a macbook pro. i think i might have pushed some buttons that made my macbook look for a wireless keyboard.. i dont have any wireless keyboard. and now i cant use the keyboard on my macbook. how can i get the normal keyboard staring?

    i have a macbook pro. i think i might have pushed some buttons that made my macbook look for a wireless keyboard.. i dont have any wireless keyboard. and now i cant use the keyboard on my macbook. how can i get the normal keyboard staring?

    korgba wrote:
    it pops up a script were it says that the macbook cannot find a bluetooth keyboard, and it isnt a keyboard connected
    For some reason, your Mac doesn't recognise that a keyboard is present, so it looks for a wireless keyboard. The question is, why doesn't your Mac recognise that a keyboard is attached?
    First, you need to make sure you remove all peripherals, especially USB peripherals (the keyboard is on the USB bus). Then restart holding down the Shift key. This should boot in Safe mode. If the computer boots normally (not in safe mode) and the keyboard is still not working, try resetting the SMC
    Intel-based Macs: Resetting the System Management Controller (SMC)
    <http://support.apple.com/kb/HT3964>
    If that still doesn't fix the problem, then the keyboard (or its controller) is probably damaged and needs to be replaced.

  • How can I add an information (including pic, text and button) area in the menu?

    The picture below is captured from on video in Adobe Muse official website. How can I add an area just like the picture shows? I mean the three sleeping bags, texts below and the learn more button.
    Thank you.
    (from http://tv.adobe.com/watch/creative-cloud-for-design/adobe-muse-november-2013-hide-menu-nav igation-on-rollout/)

    This tutorial <http://helpx.adobe.com/muse/tutorials/widgets.html> has a section titled "Hiding Composition widgets on rollout to create submenus" which covers how to use a Composition widget for this purpose.

  • How can I add a "thought bubble" to a photo?  ty

    How can I add a "thought bubble" to a photo?  TY

    Go to your Home Folder > Pictures. Here is your iPhoto Library If you didn't assign a special name then the default will be "iPhoto Library". Control-click for the contextual menu (right click if using a mouse with a secondary button) and choose; "Show Package Contents".In that new window that opens find something like this: "Originals > 2011 > …". Keep clicking open the folders until you find the desired photo. Now you can Option-drag it to the Desktop.
    No, don't do that.
    1. Accessing your files in the Library package is not supported
    2. It's dangerous. You can easily trash your Library doing this.
    3. It's inefficient. Rooting through all the folders of the Library is slow. Even iPhoto's Show File command is better than that.
    4. It's utterly unneceeasy. Just use the application in the way it's designed to work. It's safe and fast. Simply set Preview (or whatever) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Preview or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Other than that:
    There are many, many ways to access your files in iPhoto:   You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    There's a similar option in Outlook and many, many other apps.  If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    If you want to access the files with iPhoto not running:
    For users of 10.6 and later:  You can download a free Services component from MacOSXAutomation  which will give you access to the iPhoto Library from your Services Menu.
    Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and 10.5 Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    Drag and Drop: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    File -> Export: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    Show File:  a. On iPhoto 09 and earlier:  Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.    3.b.
    b: On iPhoto 11 and later: Select one of the affected photos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder window will pop open with the file already selected.
    Regards
    TD

  • I'm setting up Apple ids, and its not giving me the option to set up a rescue email. How can I add one?

    I'm setting up Apple IDs, and its not giving me the option to set up a rescue email. I've set up Apple ID's in the past, and its always given me the option. How can I add a rescue email?

    You can find the instructions here. I removed the screenshots but the text is copied below.
    http://support.apple.com/kb/HT5312?viewlocale=en_US&locale=en_US
    You can edit or delete your rescue email address at My Apple ID. To edit your rescue email address:
    Navigate to My Apple ID using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so. 
    After you've validated your identity by correctly answering your security questions, click Edit to the right of your rescue email address.
    Once you've finished editing your rescue email address, click the Save button directly below the email field.  

Maybe you are looking for

  • SSO error message when publishing a BI 7.0 report to the NW04s Portal

    Please indicate how to resolve the following SSO error message received when publishing a BI 7.0 report from Query Designer to a PCD folder on a NW04s Portal: Java system error: call FM RSRD_X_MAP_TO_PRTL_USERS_PROXY to ProgId (server alias)_PORTAL_A

  • Error in script task "The name 'file' does not exist in the current context"

    I am new to the c# scripting and SSIS come from PHP and Foxpro. I am using SSIS with a script task and I am getting am errror "The name 'file' does not exist in the current context" in the following code in the picture below: (See Why does the object

  • Arch as a light-weight virtualbox host?

    I'd like to setup a boot option for an ultra-light-weight host for some VirtualBox VMs. These VMs (Windows XP, Windows 7, Mac SOX) are going to run some processor/RAM intensive programs, so I want to be able to dedicate as much RAM as possible to the

  • Changing requirement type in sales order

    Hello, I'm tryin' to change the position requirements type in an existing sales order (switching between make-to-order and make-to-stock). Both options are available to choose (KE and KSV). But after saving the order the field is grey and no longer a

  • HRHAP_PA_ECM_PERFORMANCE_GET

    Hi All,   Does anyone know how to use FM HRHAP_PA_ECM_PERFORMANCE_GET.   I always get runtime error OBJECTS_OBJREF_NOT_ASSIGNED_NO.   Please share sample code. Regards, Ikrar