Netbeans wont allow JFrame resize

Hi Guys,
I have just started using Netbeans 6.1 and am new to the netbeans environment for Java. I have been writing a simple GUI and it has been working fine until now. The GUI displays a JFrame which consists of a few panels, etc and some painted components. All was fine until today when I modified one of the panels indivigually when I went back to the main JFrame it had been reduced to a really small size as in a size of 0. Any attempts to rezise the JFrame or run the program results in the Netbeans error:
java.lang.IllegalArgumentException: Invalid size
     at org.jdesktop.layout.GroupLayout.checkResizeType(GroupLayout.java:223)
     at org.jdesktop.layout.GroupLayout.checkSize(GroupLayout.java:208)
     at org.jdesktop.layout.GroupLayout.access$500(GroupLayout.java:85)
     at org.jdesktop.layout.GroupLayout$GapSpring.<init>(GroupLayout.java:2851)
     at org.jdesktop.layout.GroupLayout$SequentialGroup.add(GroupLayout.java:1588)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:317)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:253)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:251)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:253)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:174)
     at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.setupContainerLayout(SwingLayoutBuilder.java:107)
     at org.netbeans.modules.form.VisualReplicator.setupContainerLayout(VisualReplicator.java:791)
     at org.netbeans.modules.form.VisualReplicator.updateContainerLayout(VisualReplicator.java:324)
     at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2241)
     at org.netbeans.modules.form.FormDesigner$FormListener.processEvents(FormDesigner.java:2186)
     at org.netbeans.modules.form.FormDesigner$FormListener.formChanged(FormDesigner.java:2145)
     at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:1268)
     at org.netbeans.modules.form.FormModel.fireEventBatch(FormModel.java:1241)
     at org.netbeans.modules.form.FormModel.firePendingEvents(FormModel.java:1204)
     at org.netbeans.modules.form.FormModel.access$000(FormModel.java:62)
[catch] at org.netbeans.modules.form.FormModel$2.run(FormModel.java:1184)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
     at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
This is probably a simple thing I have done wrong here but none of the properties seem to allow me to resize?
any assistance would be much appreciated.
cheers
Tony

Thanks mate, I reverterd to an older history when it was working and did the clean build seemed to fix the issue.
Cheers

Similar Messages

  • How to resize the components in a JFrame when the JFrame Resizes?

    Hi all,
    i have some problems with my app. I have set the JFrame resizable and that works fine for the JFrame but not for the components in the JFrame.
    So my question is how can i set the components in a JFrame to resize automatically when the JFrame resizes?
    Here are the important things from my code,...if you need more, just let me know, its my first post in a forum .
    Its a JFrame with a JTabbedPane and on the Tabs are Panels with buttons and Tables.
    Thank you in advance!
    public class MainMonitor extends JFrame {
    public MainMonitor() {
              super();
              initialize();
              setVisible(true);
         private void initialize() {
              this.setSize(1145, 785);
              this.setIconImage(Toolkit.getDefaultToolkit().getImage("Images/c.gif"));
              this.setContentPane(getJContentPane());
              this.setTitle("Company Manager");
              this.setResizable(true);
              this.setLocationRelativeTo(null);
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.setOpaque(true);
                   jContentPane.add(getJTabbedPane(), null);
                   jContentPane.add(getJPanel11(), null);
              return jContentPane;
         private JTabbedPane getJTabbedPane() {
              if (jTabbedPane == null) {
                   jTabbedPane = new JTabbedPane();
                   jTabbedPane.setLocation(new Point(6, 69));
                   jTabbedPane.setSize(new Dimension(1120, 684));
                   jTabbedPane.addTab("P", null, getJPanel(), null);
                   jTabbedPane.addTab("K", null, getJPanel1(), null);
                   jTabbedPane.addTab("B", null, getJPanel2(), null);
              return jTabbedPane;
         

    Giasaste wrote:
    Thanks a lot, i didnt knew that the Layout Manager is a must.It's not a must, but it is the way to allow your app to be resized nicely and makes it much easier to maintain and enhance your program. Imagine creating a complex gui then later decide that you want another radiobutton and to remove a jlabel / jtextfield pair. with layout managers a chore becomes easy.

  • JFrame resizing

    Hi,
    I have a JFrame, it displays on the right upper corner the icons minimize, maximize and exit.
    Minimize and Exit icons are working fine.
    I have the problem with the maximize button.
    The application I am writing allows to resize the JFrame. Thats fine!
    If I run the application, it has an initial size w=800, h=600
    If I click the maximize button, the JFrame fits to the window maximal size.
    But if I click the maximize button again, I want to have the initial size. This does not work.
    It keeps the maximal size.
    How can I switch
    - between maximal size and "initial" size
    or
    - between maximal size and last set size (so the size before Jframe was maximized)
    if I click the maximize button.
    Thanks
    A.

    Hi,
    I found the issue and fixed it.
    The issue is the following code.
    If I run the application, I call this function, it works fine.
    What it does is, it just horizontal center the window.
      public static void centerWindow(Window window) {
          Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
          int x = (int)((screen.width - window.getSize().width) / 2);
          int y = 0;
          window.setLocation(x, y);
      }If I run this function later on again after resizing the window, it causes the issue.
    So if I resize the window, I don't call this function anymore.
    Thanks
    A.

  • Implementing JFrame Resizing Rules?

    Recently I've needed to enforce rules on a JFrame's dimensions (for example: preserving an aspect ratio).
    The obvious solution is to call setSize() from ComponentListener's componentResize() method. This is functional, but looking at the Java source, it's pretty inelegant. It actually starts a setSize() -> componentResized() -> setSize() loop that only terminates when setSize() is called with dimensions matching the current dimensions (see Component.reshape()). Also, its visually ugly because when maximized you can see the window snap back to the "fixed" size.
    It would seem that a more elegant way to add this functionality would be to have a method like "public Dimension checkDimensions(Dimension)" available for overriding.
    Does something like this already exist that I've missed?
    I've tried following the source, but I can't find the place where JFrame resizing is handled.

    The optimal solution would be to use a Look&Feel which doesn't have to use the OS window decorations, so the resize events are only generated in Java (not optimal in the fact that you don't get to have the OS frame decorations of course). Then you should be able to add your own RootPaneUI which simple doesn't allow resizing beyond a maximum size or auto resizing respecting an aspect ratio.
    See JFrame#isDefaultLookAndFeelDecorated and (for example) MetalRootPaneUI#MouseInputHandler. Perhaps there are thrid party look and feel where you can more easily replace a similar handler.

  • I have photoshopp cc, and I am used to photoshop elements. In photoshop it wont allow me to just click on a layer, and have it select that layer . I have to click on the layer in the box that shows all my layers in order to select it. I also want it to no

    I have photoshop cc, and I am used to photoshop elements. In photoshop it wont allow me to just click on a layer, and have it select that layer . I have to click on the layer in the box that shows all my layers in order to select it. I also want it to not only select the layer on the actual project, but put a hashed line around it that allows me to resize it manually, without having to do it in another window. Does that make sense? I cant even get the layer to select. PLEAE HELP. Id also be able to just click on the layer and drag it. It wont let me, and I am confused.

    If you were serious to learn Photoshop, I'd advise you to take Photoshop classes at your nearest community college or some such institution, to take a subscription to lynda.com, to watch all the Photoshop videos at Adobe TV, to google for specific video tutorials on You Tube and for other tutorials in text format.
    Even the Help menu in Photoshop can be a great starting place.
    Don't expect to find in Photoshop the kind of hand-holding features that Elements has and that appeal to beginners and amateurs.

  • JFrame (resize -- disallow certain size)

    Hi,
    I have some code that disallows a JFrame from being resized smaller than a certain width and height. (see code below)
    But my problem is that this code allows the frame to be resized for a split second before it resizes it back to the defined minimum. My question is:
    Is there a way I can get the frame to NOT be resized below a certain width and height? Hence, when the user grabs the corner of the JFrame and tries to make the window smaller than the minimum defined width and height, the frame just stops moving (i.e. it becomes rigid and not elastic).
    The main reason for this question is that everything works great most of the time but since the frame is allowed to resize to a very small size for a split second some of my components get squished. I have set their min, max, and preferred size too, but it still squishes them and they are un-squishable after it happens. This would never occur if there was a way to do what I propose above.
    public final static void lockInMinSize(final JFrame frame, int width, int height){
       final int origX = width;
       final int origY = height;
       frame.addComponentListener(new ComponentAdapter() {
          public void componentResized(ComponentEvent event) {
             frame.setSize((frame.getWidth() < origX) ? origX : frame.getWidth(),
                 (frame.getHeight() < origY) ? origY : frame.getHeight());
    }

    The main reason for this question is that everything works great most
    of the time but since the frame is allowed to resize to a very small size
    for a split second some of my components get squished.As a rule, I place all of my panels into one large "content" JPanel. This content panel is then placed in a JScrollPane. It's the scroll pane that gets added to the JFrame's contentPane. The scroll policy (both horizontal and vertical) on the scrollPane is SCROLL_AS_NEEDED.
    After calling pack() on the frame, the frame comes up perfectly without visible scrollBars, since I've been diligent in giving each individual widget (JTextFields, JLists, etc.) a preferredSize.
    As the frame gets stretched, the fields adapt accordingly and still look fine. As the frame is shrunk, the fields squish only to their original positions. Anything more would cause the scrollBars kick in.
    So, I always size all of the individual fields, but never the panels or frames.
    Keep in mind that different layout managers rely on different sizes for the components. Since I use GridBag for the individual panels, I make sure to give each component a preferredSize
    I guess as an alternate, after construction is complete you could pack the frame, then call getSize to capture its "natural" size. Use this natural size for comparison in your componentResized method.
    Hope this helps. Good luck.

  • Adobe wont allow me to renew my license

    Hey,
    so, my company CC got cancelled, and ever since it wont allow me to use a difference card. Customer support just send me round in circles always promising to call back, but never do. Has anyone ever had a similar problem / solution? I deseperatey need access to the software but the folks on the end of the phone really couldnt care less and dont even repsond to update to the online ticket/case system.
    Ps...should say, I'm talking about Creative Cloud.
    Thanks
    Mark

    Hi Jeff,
    many thanks for getting back to me. The error message I get is on step 5, it simply says "We'll look into that and get back to you" followed by "you should get an email from us in the next business day etc etc" I've tried this a few times using different cards, both personal and company cards, debit and credit. My case number is #0211430930.
    I've spoken to numerous people in customer suppport but all they say is they'll escalate it, but no one rings back.
    Thanks again for your help.
    Mark

  • My problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set sav

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/986549 /questions/986549]''
    my problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set save downloads to my e drive....but still firefox keeps saving them to my c drive....i have 4 internal hard drives in my rig....and have tried saving downloads to them all.......why this is happening i cant understand....i have tried lots of suggestions....and have re-installed firefox multiple times

    hello, there's a general regression in firefox 27 that won't allow files to download directly into a root drive. please try to create a subfolder (like ''E:\Downloads'') and set this as default location for downloads...
    also see [https://bugzilla.mozilla.org/show_bug.cgi?id=958899 bug #958899].

  • HT4623 I updated my iphone 4s on my computer - I lost a lot of pictures - it gave me messages that I had sent back in June and now it wont allow me to play any of my itunes on my phone - any got any solutions to what I should do? HELP

    I updated my iphone 4s on my computer - I lost a lot of pictures - it gave me messages that I had sent back in June and now it wont allow me to play any of my itunes on my phone - any got any solutions to what I should do? HELP

    I couldn't find the edit button on my original post so I am posting an update here.
    I have gone through more apps and have had good luck on all but one more.  And it's not that the app doesn't work, I am talking about the Yahoo Weather app, It works fine, but when you swipe between cities the screen lags a bit and it sometimes doesn't move between pages the way it should.  On iOS 7.1.2 it was smooth as butter but on iOS 8.0, not so much.  I will post a note in the app store to let them know.  I really like the Yahoo app better than the new stock app.
    I have been going through my games and they all work fine. Angry Birds (Original and Stella), Canabalt, Minecraft, Bejeweled 2, Silly Walks, PopWords, Doodle Jump, Deep Green all seem to work just fine. 
    Starbucks app works as it should. 
    I will stop back again next week after I have had the weekend to play with it in detail and post my thoughts again.

  • Iphone 3gs wont allow me to enter password

    My iphone 3gs wont allow me to enter my password.  the graphics on the phone seem to show the basic framework - ie boxes around the numbers etc.

    Try resetting your iPhone by pressing the home and sleep buttons until you see the Apple logo, ignoring the slider. Takes about 5-15 secs of button holding and you won't lose any data or settings.

  • When we try to buy a new app or update our existing apps, my account settings wont allow me to enter ANY of my credit cards.  It says to contact apple/itunes/support, but when I do, I don't understand how to navigate it to find an answer.  Help!

    when we try to buy a new app or update our existing apps, my account settings wont allow me to enter ANY of my credit cards.  It says to contact apple/itunes/support, but when I do, I don't understand how to navigate it to find an answer.  Help!

    Click here and ask the iTunes Store staff for assistance.
    (108048)

  • My iphone 4S wont allow me to restore a bckup of icloud it has just rebooted the os and for over 24 hours i have been trying to fix it i use this phone for my job so i need help

    My iphone 4S wont allow me to restore a bckup of icloud it has just rebooted the os and for over 24 hours i have been trying to fix it i use this phone for my job so i need help. when i try to restore it says "Your iphone could not be activated becuase the activation server is unavailable, If the problom presests goto apple.com/support"   It has done this for 27 hours now PLEASE HELP!!!!!!!!!

    - Connect the iPod to the computer and see if iTunes sees it. If it sees it try to get the photos off the iPod.
    - Next let the battery fully drain. It will likely take days. After charging for at least an hour try again
    - Last, make an appointment at the Genius Bar of an Apple store.

  • My iphone 4 wont allow me to connect to my home wifi or anyother i have reset my phone and wireless router and still wont allow me what is the problem ?

    my iphone 4 wont allow me to connect to wifi of any sort  i have rest the settings on my phone and my wireless router whats the problem

    Use this article: iOS: Troubleshooting Wi-Fi networks and connections

  • HT1386 When i connect my iPhone to iTunes, it says i have to set up my iPhone, and wont allow me to sync any media i have already purchased on it. My phone is not new, so I dont understand? This all came about when i updated the iOS 6 software.

    When i connect my iPhone to iTunes, it says i have to set up my iPhone, and wont allow me to sync any media i have already purchased on it. My phone is not new, so I dont understand? This all came about when i updated the iOS 6 software. I have tried to re-set up my phone but it makes no difference and deletes everything off my phone.

    bubblesblom wrote:
    Okay, so my friends think it is funny to change the passcode on my iPhone.
    Maybe you should get new friends.
    I'm not sure that recovery mode works when you have to trust the computer, but did you try it?
    If you can't update or restore your iOS device - Apple Support
    If that won't work, perhaps you can use Find my iPhone from a computer in your iCloud.com account to erase the device.
    iCloud: Erase your device - Apple Support
    This has nothing to do with the Find my iPhone app being installed on the phone, but you do have to have Find my iPhone activated in the iCloud settings on the phone.

  • My Ipod touch wont allow me to sync any apps from my itunes library. It also wont allow me to get into itunes from the ipod itself. So i downloaded some apps from the istore on my computer, but it wont allow me to sync them to the ipod. Please Help!?

    My Ipod touch wont allow me to get into itunes. So I downloaded some apps through istore onto the itunes on my computer, yet it still wont allow me to sync them to my ipod. It doesnt even give me the option to do so. The only things syncing to my ipod are music and pictures. Can anyone please help me??

    You need to restore the iPod on the new computer. You can only sync apps (and some other stuff) from different computers/libraries but you can manage music and some other stuff among different computers/libraries.
    You need to restore you iPod and see the following regarding the pairing error message.
    pairing record ?: Apple Support Communities
    A fix for those "Pairing Record Missing" errors | TUAW - The Unofficial Apple Weblog

Maybe you are looking for

  • Ctrl and shift alt shortcuts not working in Illustrator CS4

    Hi Can´t seem to get these keys to work properly. For instance while drawing with the rectangle tool then pressing shift to get a square does not give me a square, all I get is a tooltip balloon saying "shift" same goes with ctrl and alt and spacebar

  • Need to create a Calender in WebDynpro for ABAP

    Hi, Tcode SSC1 displays owner's calender. I need to create same calender in WebDynpro for ABAP. I couldn't find any standard component usage for the same. Is there any component usage for the same or is there any altenative to create the same? It's q

  • In time capsule, can ethernet ports used for windows pc as a LAN?

    in time capsule, can ethernet ports used for windows pc as a LAN?

  • Data package and data packet

    Hit i want to know the difference between data package and data packet .when this comes in sap bw with regards tushar

  • Thrive

    For some unknown reason, my tablet is stuck in landscape mode. I have literally checked every thing. It should change when I set it in portrait but doesn't. Can anyone help?