The component  couldn't get smaller  using gridbaglayout

There is a vertical jsplitpane ,the upper part contains button,jtable,combox using gridbaglayout,I have set the GridBagConstraints.weightx,weighty to 1. The problem is when I drag divider to change upper size,it couldn't get smaller, even if I set all of the upper components' minimumsize to a tiny value.
here is the code, I wrote it in windowsbuilder (a kind of eclipse swing plugin), I guess you can see it using ve too.
package frame;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Rectangle;
import javax.swing.JSplitPane;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import java.awt.Color;
import javax.swing.JComboBox;
import javax.swing.JButton;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
public class FrmMain extends JFrame {
     private JPanel contentPane;
     private JTable table;
      * Launch the application.
     public static void main(String[] args) {
          createWin();
      * Create the frame.
     public FrmMain() {
          setTitle("Notebook");
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setBounds(100, 100, 573, 465);
          setBounds(new Rectangle(0, 0, 980, 738));
          contentPane = new JPanel();
          contentPane.setBounds(new Rectangle(0, 0, 980, 0));
          contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
          contentPane.setLayout(new BorderLayout(0, 0));
          setContentPane(contentPane);
          JSplitPane splAll = new JSplitPane();
          splAll.setDividerSize(10);
          splAll.setOneTouchExpandable(true);
          contentPane.add(splAll, BorderLayout.CENTER);
          JSplitPane splRight = new JSplitPane();
          splRight.setContinuousLayout(true);
          splRight.setDividerSize(10);
          splRight.setOneTouchExpandable(true);
          splRight.setOrientation(JSplitPane.VERTICAL_SPLIT);
          splAll.setRightComponent(splRight);
          JPanel pnlRightUp = new JPanel();
          splRight.setLeftComponent(pnlRightUp);
          GridBagLayout gbl_pnlRightUp = new GridBagLayout();
          gbl_pnlRightUp.columnWidths = new int[]{36, 54, 227, 88, 88, 211, 0};
          gbl_pnlRightUp.rowHeights = new int[]{23, 363, 0};
          gbl_pnlRightUp.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
          gbl_pnlRightUp.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
          pnlRightUp.setLayout(gbl_pnlRightUp);
          JLabel label = new JLabel("\u5F53\u524D\u6709");
          GridBagConstraints gbc_label = new GridBagConstraints();
          gbc_label.anchor = GridBagConstraints.WEST;
          gbc_label.insets = new Insets(0, 0, 5, 5);
          gbc_label.gridx = 0;
          gbc_label.gridy = 0;
          pnlRightUp.add(label, gbc_label);
          JLabel lblCount = new JLabel("New label");
          lblCount.setForeground(Color.BLUE);
          GridBagConstraints gbc_lblCount = new GridBagConstraints();
          gbc_lblCount.anchor = GridBagConstraints.WEST;
          gbc_lblCount.insets = new Insets(0, 0, 5, 5);
          gbc_lblCount.gridx = 1;
          gbc_lblCount.gridy = 0;
          pnlRightUp.add(lblCount, gbc_lblCount);
          JComboBox tfKey = new JComboBox();
          GridBagConstraints gbc_tfKey = new GridBagConstraints();
          gbc_tfKey.fill = GridBagConstraints.HORIZONTAL;
          gbc_tfKey.insets = new Insets(0, 0, 5, 5);
          gbc_tfKey.gridx = 2;
          gbc_tfKey.gridy = 0;
          pnlRightUp.add(tfKey, gbc_tfKey);
          JLabel label_1 = new JLabel("\u6761");
          GridBagConstraints gbc_label_1 = new GridBagConstraints();
          gbc_label_1.anchor = GridBagConstraints.WEST;
          gbc_label_1.insets = new Insets(0, 0, 5, 5);
          gbc_label_1.gridx = 2;
          gbc_label_1.gridy = 0;
          pnlRightUp.add(label_1, gbc_label_1);
          JButton btnSearch = new JButton("\u641C\u7D22");
          GridBagConstraints gbc_btnSearch = new GridBagConstraints();
          gbc_btnSearch.anchor = GridBagConstraints.NORTH;
          gbc_btnSearch.fill = GridBagConstraints.HORIZONTAL;
          gbc_btnSearch.insets = new Insets(0, 0, 5, 5);
          gbc_btnSearch.gridx = 3;
          gbc_btnSearch.gridy = 0;
          pnlRightUp.add(btnSearch, gbc_btnSearch);
          JButton btnType = new JButton("\u7C7B\u522B\u7EF4\u62A4");
          GridBagConstraints gbc_btnType = new GridBagConstraints();
          gbc_btnType.anchor = GridBagConstraints.NORTH;
          gbc_btnType.fill = GridBagConstraints.HORIZONTAL;
          gbc_btnType.insets = new Insets(0, 0, 5, 5);
          gbc_btnType.gridx = 4;
          gbc_btnType.gridy = 0;
          pnlRightUp.add(btnType, gbc_btnType);
          JButton button_2 = new JButton("\u91CD\u65B0\u6253\u5F00\u7A97\u53E3");
          GridBagConstraints gbc_button_2 = new GridBagConstraints();
          gbc_button_2.anchor = GridBagConstraints.NORTHWEST;
          gbc_button_2.insets = new Insets(0, 0, 5, 0);
          gbc_button_2.gridx = 5;
          gbc_button_2.gridy = 0;
          pnlRightUp.add(button_2, gbc_button_2);
          JScrollPane spData = new JScrollPane();
          GridBagConstraints gbc_spData = new GridBagConstraints();
          gbc_spData.fill = GridBagConstraints.BOTH;
          gbc_spData.gridwidth = 6;
          gbc_spData.gridx = 0;
          gbc_spData.gridy = 1;
          gbc_spData.weightx=1;
          gbc_spData.weighty=1;
          pnlRightUp.add(spData, gbc_spData);
          table = new JTable();
          spData.setViewportView(table);
          JScrollPane scrollPane = new JScrollPane();
          splRight.setRightComponent(scrollPane);
          JTextArea taContent = new JTextArea();
          scrollPane.setViewportView(taContent);
          splRight.setDividerLocation(400);
          JScrollPane scrollPane_1 = new JScrollPane();
          splAll.setLeftComponent(scrollPane_1);
          JList lstType = new JList();
          scrollPane_1.setViewportView(lstType);
          splAll.setDividerLocation(180);
     public static void  createWin(){
          EventQueue.invokeLater(new Runnable() {
               public void run() {
                    try {
                         try {
                           UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                       } catch (ClassNotFoundException e) {
                           e.printStackTrace();
                       } catch (InstantiationException e) {
                           e.printStackTrace();
                       } catch (IllegalAccessException e) {
                           e.printStackTrace();
                       } catch (UnsupportedLookAndFeelException e) {
                           e.printStackTrace();
                         FrmMain frame = new FrmMain();
                         frame.setVisible(true);
                    } catch (Exception e) {
                         e.printStackTrace();
}thanks.

I found the reason. the code below defines the jtable height as 363 pixels,so the divider couldn't make the upper part less than 363 pixels. I don't know why divider cound't but draging win could. Gridbaglayout is so complex.
gbl_pnlRightUp.rowHeights = new int[]{23, 363, 0};if I use BorderLayout and put jtable into center in the upper part of splitpane, everything is ok. But if I had to use gridbaglayout,what was I gonna do?

Similar Messages

  • Just when I thought the service couldn't get any worse...

    I "upgraded" to 150Mb fios last September.  Since then I've experienced consistent Internet service interruptions.
    My calls to Verizon service tech support have been met with their replacing my router, ONT box, and continued assurances the issue would be resolved quickly.  The latest time consuming interaction occurred this morning when their tech support engineer told me they would be working on the problem today.
    Now I don't have phone dial tone.  Could that be related to either verizon trying to fix the problem or perhaps some tech support guy being a bit vindictive?
    I'm also wondering how much longer it will be, beyond the 30 minutes I've aloready been sitting on hold, before I can talk to someone at Verizon about the phone issue. 

    Same here.  I upgraded awhile back to HS and have had problems with drops.  However, it has become much worse.  While watching a movie(s)  from Amazon.com via Roku (wireless connection).  The connection some time slows down until the movie freezes and I have to go out and return.  Most of the time the connection just drops.  I get a message from the Roku player to check my connection.  I try several times without success.  Then I notice the Internet connection light just goes out.  Turn off/on the router "hope" the Internet light comes back on.  After severe power off/power on it might stay on. 
    I had to do this so many times last night I just gave up watching the movie.  I ended up connecting the Roku directly to the router with a cable.  This worked better but the connection still went down twice.  Very, very frustrating.  I hesitate calling Tech Support  because their "send a signal" very seldom works.  Then they offer to send out a tech (with me possibly getting charged).  Finally, the noise on my phones (yes using the filter on both) is so bad along with the "false rings" I just unplug the phones.    

  • How to find a data with the minimum value I get without using sub query

    Currently, I manage to get a record by using subquery to find the minimum number, eg:
    SELECT TAccTrn.ASysCde
    FROM TAccTrn
    WHERE TAccTrn.AAccTrnNum=(SELECT Min(TAccTrn.AAccTrnNum)
    FROM TAccTrn, TDbtSchCltDtl
    WHERE TDbtSchCltDtl.ASrcRefId=TAccTrn.ASrcRefId
    AND TDbtSchCltDtl.ASrcRefSubId=TAccTrn.ASrcRefSubId
    AND TDbtSchCltDtl.ASrcRefSeq=TAccTrn.ASrcRefSeq)
    Is there any more idea without using the subquery?

    Hi ,
    What about using an in-line view and the row_number () analytic function...????
    Here is an example....
    SQL> select * from emp;
    EMPNO ENAME      JOB         MGR HIREDATE          SAL      COMM DEPTNO
    7369 SMITH      CLERK      7902 18/12/1980     800,00               20
    7499 ALLEN      SALESMAN   7698 20/02/1981    1600,00    300,00     30
    7521 WARD       SALESMAN   7698 22/02/1981    1250,00    500,00     30
    7566 JONES      MANAGER    7839 02/04/1981    2975,00               20
    7654 MARTIN     SALESMAN   7698 28/09/1981    1250,00   1400,00     30
    7698 BLAKE      MANAGER    7839 01/05/1981    2850,00               30
    7782 CLARK      MANAGER    7839 09/06/1981    2450,00               10
    7788 SCOTT      ANALYST    7566 18/04/1987    3000,00               20
    7839 KING       PRESIDENT       17/11/1981    5000,00               10
    7844 TURNER     SALESMAN   7698 08/09/1981    1500,00      0,00     30
    7876 ADAMS      CLERK      7788 21/05/1987    1100,00               20
    7900 JAMES      CLERK      7698 03/12/1981     950,00               30
    7902 FORD       ANALYST    7566 03/12/1981    3000,00               20
    7934 MILLER     CLERK      7782 23/01/1982    1300,00               10
    14 rows selectedUsing a solution like the one you don't want ...(a subquery) i would write....
    SQL> select ename from emp
      2    where hiredate=(select min(hiredate) from emp)
      3  /
    ENAME
    SMITHWhereas , using an in-line view....
    SQL> select ename from
      2   (
      3    select ename,row_number() over(order by hiredate asc) row_num from emp
      4    )
      5  where row_num=1
      6  /
    ENAME
    SMITHIs it acceptable...????
    Regards,
    Simon

  • TS3623 "An error occurred loading this content..try again later" is the message that I get when using my Apple TV remote.  I click on Breaking Bad; then I click on an episode and get the message which I just quoted.  Is this a Netflix problem?

    Why am I getting the following message when using my Apple TV remote on Netflix:  "An error occurred loading this content....try again later?

    Make sure DNS is set to ISPs (settings - general - network - DNS should be set to automatic). Trey rebooting ATV, and router. Make sure all are up to date.

  • How to open the file when i get it using Datasocket?

    I get a file using datasocket,for example ,a bmp file.but How can i
    open it on my computer? It just save in some buffers.
    please explain in details.
    Thanks in advance.

    You need to convert the image file to a 2D array then transport the array via datasocket.
    Take a look at this example program:
    Convert Image to Array
    Ray K
    Applications Engineer

  • I have loaded FF twice, and on the START PAGE I get small arrows superimposed over the word "WEB". It looks like a mistake.

    There are 3 up/down arrows over and superimposed over the
    word WEB on the start page. What use are they? It looks like
    2 small rectangles with info in them, and both trying to occupy
    the same place.
    Thanks for your help.

    Opening in the sidebar is the default for bookmarks that are created via a link or button on a website.<br />
    You can check the Properties of a bookmark via the right-click context menu in the sidebar (Ctrl+B; Cmd+B on Mac).<br />
    In the Bookmarks Manager (Bookmarks > Show All Bookmarks) you can click the More button in the Details pane at the bottom right.<br />
    Make sure that "Load this bookmark in the sidebar" is not selected.
    Does it help if you open other content like the bookmarks (Ctrl+B) in the sidebar and close the sidebar via the close X?
    You can also check for problems with the localstore.rdf file.
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

  • IIs there any way of loading in a MM54C221J component into multisim with out having to use the component wizard?

    Im trying to use a MM54C221J multivibrator in multisim, but it's not in the library.
    Does anyone know if I can get hold of one with having to use the component wizard?
    Many thanks 

    Hello GFear,
    There are several sources for components that aren't native to multisim.
    You can directly contact the manufacturer of the component should they have the multisim model available.
    You can also search the web incase another user has created the component.
    I have searched for the MM54C221J and have not found one available online.
    If you are having trouble using the Component Wizard here is a useful link that breaks down each of the steps.
    To create a component you will need a spice model of the component which you should be able to acquire from the manufacture.
    http://zone.ni.com/devzone/cda/tut/p/id/3173
    I hope this helps.
    Regards,
    Philip
    Applications Engineer
    National Instruments
    UK Branch
    ===If this fixes your problem, mark as solution!===

  • The XML file is getting truncated after reading.

    Hi,
    I have written a code for ABAP Mapping.
    But the file which is getting generated using this mapping have missing fields.
    I tried to debug and found out that the method MAP_BY_ABAP of CL_MAPPING_XMS_PLSRV3 is causing the problem.
    The code is having one function IDX_XML_TO_IDOC which converts XML to IDOC table. I think the xml_data parameter of this function is having some missing data so it is not generating correct fields.
    If anyone can guide me on this issue will be helpful.

    hi,
    >>>>The code is having one function IDX_XML_TO_IDOC which converts XML to IDOC table.
    you have the whole code for this in this doc:
    https://websmp110.sap-ag.de/~sapdownload/011000358700001795162005E/HowToIDocXMLToFlat.pdf
    no need to reinvent the wheel
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • How do I fade with circles that get smaller and more spread?

    Can anyone tell me, (in either Illustrator or photoshop, but preferably Illustrator) how to fade out a color, but instead of the smooth fade, the solid circles that get smaller and smaller, if you know what I mean. Thanks.
    I have CS2.

    1 Make the largest circle
    <br />2. Make the smallest circle
    <br />3. position them at the distance you need the art to measure.
    <br />4. Object&gt;Blend&gt;Blend Options choose specified steps and enter the number of steps you want
    <br />5. Command Option B or Object&gt;Blend&gt;Make
    <br />
    <br />You get this
    <br />
    <br />
    <a href="http://www.pixentral.com/show.php?picture=1ogwJRWJUvf0385nQ8w84SohDe9Nx0" /></a>
    <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1ogwJRWJUvf0385nQ8w84SohDe9Nx0_thumb.png" border="0" />
    <br />
    <br />You can also specify the distance which is calculated from the center I believe.

  • How to clear just the computer name before getting image of the hard disk?

    Hi,
    I have a Win 7 PC with some applications installed on it and I don't have the installation files of the applications. Now I want to create an image of the C drive, and use it on other PCs. So I need to just clear the computer name and shutdown
    the PC and use an imaging software to make an image of the C drive, so when I deploy the image on a new computer, on the first startup screen it'll ask for JUST computer name.
    I tried to use sysprep but it look like clearing more data  than I want (just PC name). Also the AIK solution look like I have to have the installation files of all the softwares that I want to have on my computer.
    In one sentence: How to clear the computer name before getting image using a disk image tool (Acronis, Ghost,...)?

    Hi,
    Sysprep will do this job. But when the system boot up, it will generate new computer name.
    In general, you need boot to win pe after you run systprep. I think you can create a USB bootable device.
    In win pe, you can use ImageX or DISM tool to capture the image.
    I'm not fimilar with the tools you referred since they are not from Microsoft, so I cannot give any direction about it.
    For your information:
    http://technet.microsoft.com/en-us/library/cc749003(v=ws.10).aspx

  • Trying to remove itunes and its component get this"the feature you are trying to use is on a network resource that is unavailable

    trying to remove itunes and its component get this"the feature you are trying to use is on a network resource that is unavailable" click ok to try again or enter an alternate path to a folder containing the installation package "itunes.msi'

    tiburon77 wrote:
    trying to remove itunes and its component get this"the feature you are trying to use is on a network resource that is unavailable" click ok to try again or enter an alternate path to a folder containing the installation package "itunes.msi'
    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove".
    Quit out of CleanUp, restart the PC and try installing iTunes again. Does the install go through properly now?
    (If you do find a clean download site for the correct version of CleanUp, please don't tell me where it is. Without wishing to sound paranoid (although I grant it does sound paranoid), there is a non-zero chance that posting links to download locations for the utility here at Discussions leads to that download location being shut down.)

  • My internal drive is NOT showing up in the event library in Final Cut X.  I am also getting a "The operation couldn't be completed. Cannot allocate memory" Any ideas? I am using an IMAC Core i7 with 8GB memory, OS version 10.6.8

    My internal boot drive is NOT showing up in the Event Library in Final Cut X. My external raid drive is showing up.
    I am also getting error message "The operation couldn’t be completed. Cannot allocate memory"  when attempting to create a new "event".   Any ideas?
    If I had a application disk, I would unistall and reinstall FCPX.  I am assuming there is a way do do this without a disk - just have not been able to easliy find out how.
    I am using an IMAC Core i7 with 8GB memory, OS version 10.6.8
    Thanks

    Well it did NOT work.  Here is a screen capture as FCPX loads showing the drive while it loads. Then when it is loaded, NO drive showing up in the Event Library ( I have turned off the external drive).
    ANY ideas . . . .  Anybody . . . .  APPLE?

  • My iPad is stuck with a small blue screen saying iCloud Backup, this iPad hasn't been backed up in 4 weeks.Backups blah blah- Click OK. I can't get it off the screen and I can't use the iPad because of it. Can anyone out there help?

    my iPad is stuck with a small blue screen saying iCloud Backup, this iPad hasn't been backed up in 4 weeks.Backups blah blah… Click OK. I can't get it off the screen and I can't use the iPad because of it. Can anyone out there help?

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds).

  • I am using windows 7 on a lap top and using the touch pad mouse. From time to time the screen resolution on my home page gets smaller. How do I make larger?

    it seems to get smaller when I am using the mouse, can not make it get larger again

    Reset the page zoom on pages that cause problems.
    *<b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    *http://kb.mozillazine.org/Zoom_text_of_web_pages
    You can set mousewheel.with*.action pref(s) like mousewheel.withcontrolkey.action to 0 to perform a scroll.
    *mousewheel.withcontrolkey.action
    *mousewheel.withnokey.action
    *mousewheel.withshiftkey.action
    See also:
    * http://kb.mozillazine.org/About:config_entries#Mousewheel.
    *http://kb.mozillazine.org/about:config

  • I am using an early 13 inch MacBook and have kept it going for five years without problems. The hard drive is getting unreliable and needs changing. How large a hard drive can I replace it with?

    Sorry for the long title, this is the first time I have used this place.
    The local Mac engineering support in Jamaica is a small shop in town. They told me I could go up to 750 gig, which appeals to me as I use this for my business. And oldie but goodie this Mac. It is upgraded in memory to 4 gig and is operating on Lion Server.
    Recently I have been getting disk errors, which indicates the drive is getting too old and may fail soon.
    So, before I buy I figured asking what the truth is. 750 gig? Really?

    Physically, the limitation is the 9.5mm drive thickess. AFAIK, most if not all 750GB HDDs have that thickess. The next size, 1TB, has the issue that many of the brands are 12.5mm thick and won't fit, but you may get lucky and find a "thin" model in this size.
    Other thing to watch is the speed. 7200 vs. 5400 RPM is attractive, but the faster disks will run a tad hotter, which can be an issue in a single-fan 13"
    Lastly, noise. Compare the noise ratings as published in the spec sheets. Western Digital disks, for example, are usually noisier than other brands. Perfectly nornal and does not detract in performance or longevity, but having the thing buzz at you while trying to catch a quick email check at night or watch a subdued movie may be annoying.
    When you do decide and get down to doing the deed, be sure to get one of those cans of compressed air or "dusters" and thoroughly clean out the guts of the Mac. Especially around the blades of the fan, where dust tends to stick and degrade the cooling capacity of the component.

Maybe you are looking for

  • Message mapping changes

    Hi All. I created a message mapping from a custom message type towards MATMAS_BAPI01. I disabled the EDI_DC40 field and in the idoc communication channel I disabled "Apply control record values from payload". When I check the final idoc message creat

  • Update zfields in MARA table

    hi, In my client system a custom view is maintained for MM* transactions I have added two custom fields in MARA table as well as this custom view. Now i have to populate value for this two custom fields. i am using "/AFS/BAPI_MATERIAL_SAVEDATA" to up

  • JSF desing: Application with similar pages

    I have a design question regarding JSF. Sometimes, a web application consists of a set of pages that look basically the same but perform different operations in the background. As an example, consider Google that offers several search types (normal s

  • MQ in B2B

    Hi, Is it possible to create JMS binding for a MQ in the OAS of B2B. I checked but could not find options to deploy the RAR files in it. Is there any way for doing it?

  • Link in e-Mail to GP

    Hello, I have realized a GP approval workflow. Is it possible to send an e-mail to the user who is involved next containing a link which directly directs to the step the user has to perfom? Best regards Alexander