JTabbedPane resize problem

I have a JTabbedPane in a JPanel (BorderLayout.CENTER).
That JPanel is the content component of a JOptionPane.
The JOptionPane is in a JScrollPane which is in a JDialog.
When the JDialog is resized (larger), the JTabbedPane enlarges too as desired.
However, when the JDialog is resized (smaller), the JTabbedPane does not reduce in size consistently as one would wish.
Any one know why, have a solution, etc.
Any ideas appreciated.
Thanks.

I am using gl4java's GLAnimCanvas as the canvas based object in my application. Since
the Swing based gl4java object is not hardware accellerated, it is way to too slow for my application
(a 3D gui ).

Similar Messages

  • [SOLVED] GNOME 3.8 annoying window resize problem

    Hello all fellow early-adopters :-)
    A very annoying quirk I've noticed, moving from GNOME 3.6 to 3.8, is that it no longer remembers, nor retains, the size/positions I set for many of my application windows. For example, my mail client (Evolution) is sized to fill most of my screen (centrally), with Empathy and Skype as long narrow windows on both sides - giving me a nice, broad "communications" overview on that particular desktop (with dev tools etc open on others).
    On 3.6, this layout was retained during my session, as well as next time I started these apps up.
    In GNOME 3.8, not only does it insist that these windows are always started as small little bunched-up windows that I need to resize, but every time a window displays a notification/warning (message in internal yellow bar inside the window - such as loss of internet connection, mail retrieval failure etc) it resizes the windows spontaneously to a stupid, small size that overlays the other windows. This is driving me crazy!
    Where can I learn a bit more about how window sizing / positioning works in GNOME 3.8, or is it finally time to switch to awesome wm? I want to love GNOME 3.8, I really do. It's so slick, but so... unpolished.
    I want to dig in an assist with problems like these, but I need some pointers to some background material first to understand the problem. Is it the window manager? Is it the app?
    ** UPDATE: Doing a full system upgrade, as of May 18, 2013, has resolved this annoying problem. My windows now stay where they belong, and start with the same size they were closed with. GNOME is now pleasant to use again :-)
    Last edited by dawid.loubser (2013-05-21 13:37:25)

    dawid.loubser wrote:Thanks for the suggestion drtebi - I'll give it a try.
    I really like GNOME 3.x though (and would like to understand the windowing behaviour), but if the annoying quirks are insurmountable, I will happily switch.
    Man I love GNOME 3.x. I admire the courage they had to change, basically, everything, and I find myself more productive with my GNOME 3 Arch box than with my good ol' Slackware KDE 4 box. I just hate those bugs - for example I filed a task in their bugtracker for this window resize problem I have with gedit. If it's a love/hate relationship, I think it's marriage ^_^
    With the 3.8 upgrade, deadbeef was having a similar problem with window size/position. I just recompiled it against the latest GTK+3 package upgrade (that came after the 'big upgrade' here on Arch) and it was fixed. But not with gedit
    bwat47 wrote:
    Man I really hope this gets fixed soon, because aside from this one incredibly annoying issue I am loving gnome 3.8.
    I get the feeling gnome badly needs more beta testers, sizable regressions like this in "stable" releases happen way too often sad.
    I get the exact same feeling. Well bugs exist everywhere, there's no denying. But I think it would be wiser to 'alternate' the nature of each major stable release - one focusing on new features and one focusing on fixing bugs. For example if the only new features in GNOME 3.10 were the AppsFolder full implementation and the introduction of gnome-calendar, and the rest of the development cicle being devoted to fix bugs, I'd be more than happy.
    Like Fedora and Ubuntu, the fixed 6-month release cycle colaborates with the bugs. They don't do like Debian or Slackware which are released 'when they are ready'.
    EDIT: fout (yet) another bug. At least with facebook chat (haven't tested with other telepathy plugins) the buddy tray icon appear duplicate. Anybody with the same issue?
    Last edited by lmello (2013-05-02 14:06:06)

  • JTabbedPane resizing

    Hi
    I'm creating an application that uses a JTabbedPane and i want the panels in the tabs to have different sizes, what i want to know is that if its possible to have the JTabbedPane resize after you change the tab. Is there any way to this in the creation of the gui, or do I have to change some things in the JTabbedPane UI?
    Thanks for any help.

    Try using revalidate() on the JPanel that contains the tabbed pane. This should inovoke the LayoutManager and cause the components to be layout out again.

  • Preview Application Resizing Problem

    Preview Application Resizing Problem
    Microsoft platforms have two significant advantages. The first is the concept of an operating system that can function with hardware that ranges from cellular phones to desktop computers. The second is that Microsoft has excellent software development tools
    for creating and testing computer programs.
    Software compatibility across hardware platforms requires not only meeting CPU and memory requirements. Application programs must be able to automatically adjust Window and control sizes to meet the needs of available window sizes, video display unit sizes
    and screen resolutions, switching between vertical and horizontal viewing, vertical and horizontal scrolling, changes in font sizes , and variations in the available screen space due to usage of vertical and horizontal toolbars.
     Software developers must be careful that resizing doesn’t squeeze controls too close together or make them so small that they cannot be finger or stylus selected when used with touch screens.
    Some of the required automatic resizing options are provided by the Microsoft software compilers and the Windows operating system.  Softgroup Component’s “.NET  Forms Resize” is an example of one of the third party applications that provide advanced
    resizing functionality.
    Many of the resizing functions are programmer options and, if not properly enabled, an application may not have the required resizing functionality. At the current state of the art, application programs are highly variable in their capability to do the “intelligent
    resizing” that is required to handle different display environments.
    A case in point is the Microsoft Preview Application for Windows 10. When entering lengthy comments, the send button becomes positioned off the end of the program window. It is possible to scroll to the button, but the display automatically resets when scroll
    is released. The result is that the text cannot be sent. You can try a "blind" TAB to the SEND button. This appeared to work after several tries, but the comment was apparently not received,
    RERThird

    Hi,
    What do you see when you open the same PDF file in Acrobat Reader? Are the words still squeezed than?
    Dimaxum

  • Illustrator Resizing Problems

    I am having reduction resizing problems in Illustrator CS6.  E.G. Straws & lemon wedge rinds become significantly proportionately wider when reduced.   Also, numerical text does not skew with everything else.  I have a CC membership w/PS & Ai installed.  There are no other Adobe items on my 8 month old imac, Lion 10.7.4 except Flash player & the Adobe Applications Manager.  Additionally, I have no 3rd party plug-ins & deleting the prefs file does not fix the problem.  Any help on this matter would be greatly appreciated. 

    sgem,
    And untick Align to Pixel Grid if ticked (you can do it in the Transform panel, or search for it in the Helpfile).
    Hi Steve. Still summer?

  • DV resize problem with QuickTime's iPod 320 x 240 export

    Just a heads up for those with new 5th generation iPods who plan on converting their DV movies for display on the iPod. It seems that the iPod 320 x 240 export does not resize DV correctly. Here is a link concerning this problem:
    Waymen, "Possible resize problem with iPod 320 x 240 Export?" #1, 03:02am Oct 13, 2005 CDT

    This article show a workaround to have DV export correctly in QuickTime Pro
    http://docs.info.apple.com/article.html?artnum=302955

  • JSplitPane JTabbedPane Canvas resize problem

    I am using a JSplitPane to separate a tree and a JTabbedPane containing java.awt.Canvas based objects.
    I have not been able to find a way to resize the split plane over the tabbed pane. I pretty sure this
    is because the Canvas is heavyweight and the split pane lightweight, but I cannot swap out the canvas
    for a JPanel (or other swing equivalent) due to performance requirements. Is there a way to allow the
    split pane to resize over the heavyweight object?
    Below is a code snippet which illustrates what I'm trying to do. Any help would be greatly appreciated.
    Thanks!
    import javax.swing.*;
    import java.awt.*;
    public class TabTest
    public static void main(String args[])
    JFrame f = new JFrame("TabTest");
    f.setSize(800,800);
    JTree left = new JTree();
    JTabbedPane right = new JTabbedPane();
    Canvas canvas = new Canvas();
    right.add("Canvas", canvas);
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
    f.getContentPane().add(splitPane);
    f.show();
    }

    I am using gl4java's GLAnimCanvas as the canvas based object in my application. Since
    the Swing based gl4java object is not hardware accellerated, it is way to too slow for my application
    (a 3D gui ).

  • JScrollPane resizing problem, I think...

    The Task
    I want to build a dialog that holds different option panels.
    Instead of using a JTabbedPane, I want to use a JTree to select among the different panels.
    I put the tree in a nice scroll pane, place the whole thing in the left side of
    the dialog. I think I have the logic down except for one thing...
    The Problem
    Whenever I click a node when the JTree is expanded, it resizes itself. It does this so that words that go off to the right can be seen.
    I don't want this to happen, but I do have to revalidate the main panel for it to change.
    Apparently, just revalidating the main panel revalidates everything.
    The Question
    Is there a setting in the JTree or the JScrollPane that stops this from happening?
    I have tried to change the LayoutManager, but the same thing happens with GridBagLayout.
    I'll put example code in the following post so you can see my issue. I put the most pertinent code to the front, so that you don't have to read too deeply.
    Can anyone advise me?
    Thanks.

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    import java.util.*;
    public class ScrollPaneProblem extends JDialog
       implements TreeSelectionListener
       private JButton jbClose;
       private JTree optionsTree;
       private MainPanel jpMain;
       private ActionListener terminator;
       public ScrollPaneProblem()
          // I would prefer that it stay this size.
          setSize( 535, 375 );
          setResizable( false );
          setTitle( "Preferences" );
          setupGui();
          setDefaultCloseOperation( DO_NOTHING_ON_CLOSE );
       protected void setupGui()
          Container contentPane = getContentPane();
             The left side of dialog will hold the option tree.
          optionsTree = buildTheTree();
          JScrollPane scrollPane = new JScrollPane( optionsTree );
          contentPane.add( scrollPane, BorderLayout.WEST );
             The center panel will hold another panel
             that changes according to what has been selected
             in the JTree.
          JPanel centerPanel = new JPanel( new BorderLayout() );
          Box bxButtons = buildTheButtonBox();
          centerPanel.add( bxButtons, BorderLayout.SOUTH );
          jpMain = new MainPanel();
          centerPanel.add( jpMain, BorderLayout.CENTER );
          contentPane.add( centerPanel, BorderLayout.CENTER );
       } // end setupGui()
          Changes the text on the main panel, according to what
          has been clicked in the JTree.
       public void valueChanged( TreeSelectionEvent evt )
          TreePath path = evt.getPath();
          Object obj = path.getLastPathComponent();
          if ( obj instanceof DefaultMutableTreeNode )
             DefaultMutableTreeNode node =
             (DefaultMutableTreeNode)obj;
             obj = node.getUserObject();
             // The problem happens when I do the following...
             jpMain.setText( obj.toString() );
             jpMain.revalidate();
             jpMain.repaint();
          } // end if ( a DefaultMutableTreeNode )
       } // end valueChanged( TreeSelectionEvent )
       private JTree buildTheTree()
          // First, build the parent nodes
          Object [] smurfNodes =
             "Smurfette", "Vanity", "Papa Smurf",
             "Greedy Smurf", "Lazy Smurf",
             "O.J., the ostracized orange smurf"
          ParentNode theSmurfs = new ParentNode(
                                  "The Smurfs", smurfNodes );
          Object [] dwarfNodes =
             "Doc", "Happy", "Dopey", "Sneezy",
             "Scratchy", "Sniffy", "Stuffy Head",
             "Fever", "So you can rest medicine"
          ParentNode theDwarfs = new ParentNode(
                                  "The Seven Plus Dwarfs", dwarfNodes );
          // These are all the nodes that go on the tree.
          Object [] theNodes =
             "Scooby Doo",
             "Inspector Gadget",
             "Mighty Mouse",
             "Captain Caveman",
             theSmurfs,
             theDwarfs
          JTree theTree = new JTree( theNodes );
          theTree.addTreeSelectionListener( this );
          return theTree;
       } // end buildTheTree()
       public Box buildTheButtonBox()
          Box box = Box.createHorizontalBox();
          box.add( Box.createHorizontalGlue() );
          // Make it so that we can close this JDialog.
          jbClose = new JButton( "Exit" );
          jbClose.addActionListener( terminator );
          box.add( jbClose );
          box.add( Box.createHorizontalGlue() );
          // help button that does absolutely nothing.
          JButton jbHelp = new JButton( "Help" );
          box.add( jbHelp );
          box.add( Box.createHorizontalGlue() );
          return box;
       } // end buildTheButtonBox()
       // Main entry point.
       public static void main( String [] args )
          JDialog dialog = new ScrollPaneProblem();
          dialog.setVisible( true );
       // So we can shut the dialog off
       static
          terminator =
          new ActionListener()
             public void actionPerformed( ActionEvent evt )
                System.exit( 0 );
    } // end ScrollPaneProblem class
       This MainPanel class goes in the middle of the dialog.
       My other program switches panels instead of using
       the same panel, but that's too much code to put here.
    class MainPanel extends JPanel
       String theText = "Tell me what to draw";
       Font theFont = new Font( "Sans Serif", Font.PLAIN, 12 );
       Dimension theSize;
       // Draws the selected text
       public void paintComponent( Graphics g )
          super.paintComponent( g );
          theSize = getSize( theSize );
          Font oldFont = g.getFont();
          g.setFont( theFont );
          g.drawString( theText, theSize.width / 10, theSize.height / 2 );
          g.setFont( oldFont );
       public void setText( String text )
          theText = text;
    } // end class MainPanel
       This helps with the JTree parent nodes.
    class ParentNode extends Vector
       String theName;
       public ParentNode( String name )
          this( name, null );
       public ParentNode( String name, Object [] values )
          theName = name;
          if ( values != null )
             addAll( Arrays.asList(values) );
       public String toString()
          return theName;
    } // end ParentNode class

  • JTabbedPane display problems

    Can someone help me with this? I have a JTabbedPane in an applet with two tabs. Lately I have noticed that when I move the mouse pointer around on one tab, some components from the other tab start to show through and I can even click on them, resulting in other components showing through and a jumbled mess. Can anyone help me?
    Here is how I set up the layout in the init method:
    jPanelUI = new MyUIPanel();
    getContentPane().setLayout(new GridLayout(1,1,0,0));
    jPanelUI.setLayout(new GridLayout(1,1,0,0));
    // add look & feel panel to content pane
    getContentPane().add(jPanelUI);
    // add main panel to look & feel panel
    jPanelUI.add(administrationPanel);
    Here is MyUIPanel:
    public class MyUIPanel extends javax.swing.JPanel implements my.data.MyConstants
         public MyUIPanel()
         super();
         UIManager.put("TabbedPane.selected", CONTROL);
         UIManager.put("TableHeader.background", CONTROL);
         UIManager.put("ScrollBar.arrowColor", Color.green);
         UIManager.put("ScrollPane.background", CONTROL);
         UIManager.put("ScrollPane.foreground", CONTROL);
    I add the JTabbedPane to Administration panel like this...
    jTabbedPaneAdministration.setRequestFocusEnabled(false);
    jTabbedPaneAdministration.setOpaque(true);
    add(jTabbedPaneAdministration, new com.symantec.itools.awt.GridBagConstraintsD(0,2,6,10,0.5,0.5,java.awt.GridBagConstraints.WEST,java.awt.GridBagConstraints.BOTH,new Insets(15,20,20,20),0,0));
    jTabbedPaneAdministration.setBackground(new java.awt.Color(204,204,153));
    jTabbedPaneAdministration.setFont(new Font("Dialog", Font.PLAIN, 12));
    I add my two panels to administration panel like this...
    jTabbedPaneAdministration.add(jPanel1);
    jTabbedPaneAdministration.add(jPanel2);
    Any ideas?
    Thanks a bunch

    Found the problem. On the invisible tab, I was setting visibilities, depending on what components the user had permission to see. I assumed that those visibilities would only take effect on the tab that they were on, but instead they showed right through the selected tab. So it wasnt the resizing but your idea made me look to what I was doing with those panels after adding them, and I found it. Enjoy your duke $s
    Thanks

  • A resize problem I have

    Hi all,
    I have a JTabbedPane with the first tab designed with Intellij's GUI designer. The JTabbedPane, the JPanel that fills the first tab and the JFrame containig the above components are all instantiated from the main class.
    I have a nother panel also designed in the GUI designer that I add as a new tab to my tabbedpane when the program starts runing.
    My problem is:
    The first tab (created and instantiated automaticaly) maintains proportions when the JFrame is resized.
    However, the add tab's content has a fixed size which I can't get to fill the tab.
    I tried the setSize method, I tried using GridBagLayout with GridBagConstraints and nothing, it won't resize.
    Can anyone help please?
    Thanks.

    This is why using a VE before you know how to do it yourself is usually a bad idea. Without code, we can't help you, but what is almost certainly the problem is the LayoutManager for that tab's contents and it's constraints are not setup to fill the available area.
    If you used GridBagLayout you'd have to at the very least set GridBagConstraints fill to BOTH.

  • PAR Iview resizing problem....

    Hello Gurus,
    I have the following problem. I've develop a PAR Iview and i want to resize it on runtime. I've write on my PAR app. a javascript code, but the system shows me a javascript's error when i launch it on my portal, after open the error it says "EPCM Undefined" on this line:
    EPCM.subscribeEvent('urn:com.sapportals.portal:browser', 'load', initFooter);
    In my profile i've set EPCFLevel = 2, but my question is: do i have to reference or include a external jar or lib to my PAR??? witch one???. For General culture...a general info about my iview is: The type of my PAR (Iview) is: AbstractPortalComponent and it has a different namespace (com.<company>.portal.addon.footer) than the namespace i want to subscribe the event.... Please Help!!!!!, i dont know why this error happens...and how can i solve it...what am i missing here within my source code????....
    Regards,
    Mariana

    Hi Rajat,
    Thanx for answer me... now i have a question...why with the standard PAR Iviews that doesnt happens???... because that doesnt happens with all the iviews...happens only with mine's. I know that header Iviews (masthead) use the EPCM object, and it is working just fine, that is why I'm asking if there is an external library, jar, etc., that i have to include in my PAR in order to make it work. is This the only solution in my case???
    I will wait for your answer,
    Best regards,
    Mariana

  • JViewport Resize problem -- Urgent!

    I am trying to make a program that allows the user to dynamically resize a scrollable JPanel. I have added resize buttons that work well. The JScrollPane works well, but when the JViewport's View is set to the bottom right corner of the JPanel, and the user attempts to resize the JPanel, the JViewport repaints its view to the top left corner, hence undoing any resizing. Resizing should not change the View, even if the component is no longer visible in the view.
    Here is a code example (please pardon the length and lack of comments):
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    public class JViewportBug extends JPanel implements Scrollable, ComponentListener
         public JViewportBug()
              this.setLayout( null );
         public Dimension getPreferredScrollableViewportSize()
              return getPreferredSize();
         public boolean getScrollableTracksViewportHeight()
              return false;
         public boolean getScrollableTracksViewportWidth()
              return false;
         public int getScrollableBlockIncrement( Rectangle visibleRect, int orientation, int direction )
              if( orientation == SwingConstants.VERTICAL )
                   return (int)( visibleRect.getHeight() * 9 / 10 );
              return (int)( visibleRect.getWidth() * 9 / 10 );
         public int getScrollableUnitIncrement( Rectangle visibleRect, int orientation, int direction )
              return 5;
         public void componentHidden(ComponentEvent e)
         public void componentMoved(ComponentEvent e)
         public void componentResized(ComponentEvent e)
              Dimension size = ( (Component)e.getSource() ).getSize();
              this.setBounds( 0, 0, 20 + size.width, 20 + size.height );
              this.setPreferredSize( new Dimension( 20 + size.width, 20 + size.height ) );
         public void componentShown(ComponentEvent e)
         public static void main( String[] args )
              JViewportBug bug = new JViewportBug();
              JFrame frame = new JFrame( "JViewport Bug" );
              frame.setExtendedState( JFrame.MAXIMIZED_BOTH );
              JScrollPane jsp = new JScrollPane( bug );
              JPanel viewable = new JPanel();
              bug.add( viewable );
              viewable.addComponentListener( bug );
              viewable.setBounds( 10, 10, 200, 200 );
              JDesktopPane jdp = new JDesktopPane();
              jdp.setLayout( null );
              for( int i = 0; i < 8; i++ )
                   ResizeButton rb = new ResizeButton( viewable, i, true );
                   bug.add( rb );
                   viewable.addComponentListener( rb );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              viewable.setBackground( Color.white );
              frame.getContentPane().add( jdp, BorderLayout.CENTER );
              JInternalFrame jif = new JInternalFrame( "", true, true, true, true );
              jif.getContentPane().add( jsp );
              jdp.add( jif );
              jif.setSize( 500, 500 );
              bug.setPreferredSize( new Dimension( viewable.getWidth() + 20, viewable.getHeight() + 20 ) );
              jif.setVisible( true );
              frame.setVisible( true );
    class ResizeButton extends JComponent implements MouseMotionListener, MouseListener, ComponentListener
         public static final int NW_RESIZE_BUTTON = 0;
         public static final int N_RESIZE_BUTTON = 1;
         public static final int NE_RESIZE_BUTTON = 2;
         public static final int E_RESIZE_BUTTON = 3;
         public static final int SE_RESIZE_BUTTON = 4;
         public static final int S_RESIZE_BUTTON = 5;
         public static final int SW_RESIZE_BUTTON = 6;
         public static final int W_RESIZE_BUTTON = 7;
         JComponent resize;
         int buttonType;
         boolean enabled;
         public ResizeButton( JComponent aComponent, int type, boolean isEnabled )
              resize = aComponent;
              buttonType = type;
              setBounds();
              enabled = isEnabled;
              this.addMouseMotionListener( this );
              this.addMouseListener( this );
         public int getType()
              return buttonType;
         public void mouseEntered( MouseEvent e )
              if( enabled )
                   switch( ( (ResizeButton)e.getSource() ).getType() )
                        case 0:
                             getParent().setCursor( new Cursor( Cursor.NW_RESIZE_CURSOR ) );
                             break;
                        case 1:
                             getParent().setCursor( new Cursor( Cursor.N_RESIZE_CURSOR ) );
                             break;
                        case 2:
                             getParent().setCursor( new Cursor( Cursor.NE_RESIZE_CURSOR ) );
                             break;
                        case 3:
                             getParent().setCursor( new Cursor( Cursor.E_RESIZE_CURSOR ) );
                             break;
                        case 4:
                             getParent().setCursor( new Cursor( Cursor.SE_RESIZE_CURSOR ) );
                             break;
                        case 5:
                             getParent().setCursor( new Cursor( Cursor.S_RESIZE_CURSOR ) );
                             break;
                        case 6:
                             getParent().setCursor( new Cursor( Cursor.SW_RESIZE_CURSOR ) );
                             break;
                        case 7:
                             getParent().setCursor( new Cursor( Cursor.W_RESIZE_CURSOR ) );
         public void mouseExited( MouseEvent e )
              if( enabled )
                   getParent().setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
         public void mouseClicked( MouseEvent e )
         public void mousePressed( MouseEvent e )
         public void mouseReleased( MouseEvent e )
         public void mouseMoved( MouseEvent e )
         public void mouseDragged( MouseEvent e )
              if( enabled && e.getSource() instanceof ResizeButton )
                   int clickedX = e.getX();
                   int clickedY = e.getY();
                   int width, height;
                   switch( ( (ResizeButton)e.getSource() ).getType() )
                        case NW_RESIZE_BUTTON:
                             width = resize.getX() + resize.getWidth() - this.getX() - clickedX > 1 ? resize.getX() - this.getX() - clickedX + resize.getWidth() : 1;
                             height = ( resize.getY() + resize.getHeight() - this.getY() - clickedY > 1 ? resize.getY() - this.getY() - clickedY + resize.getHeight() : 1 );
                             resize.setBounds( resize.getX() + resize.getWidth() - this.getX() - clickedX > 1 ? this.getX() + clickedX : resize.getX() + resize.getWidth() - 1,
                                                           resize.getY() + resize.getHeight() - this.getY() - clickedY > 1 ? this.getY() + clickedY : resize.getY() + resize.getHeight() - 1,
                                                           width,
                                                           height );
                             break;
                        case N_RESIZE_BUTTON:
                             height = resize.getY() + resize.getHeight() - this.getY() - clickedY > 1 ? resize.getY() - this.getY() - clickedY + resize.getHeight() : 1;
                             resize.setBounds( resize.getX(),
                                                           resize.getY() + resize.getHeight() - this.getY() - clickedY > 1 ? this.getY() + clickedY : resize.getY() + resize.getHeight() - 1,
                                                           resize.getWidth(),
                                                           height );
                             break;
                        case NE_RESIZE_BUTTON:
                             width = this.getX() + clickedX - resize.getX() > 1 ? this.getX() + clickedX - resize.getX() : 1;
                             height = resize.getY() + resize.getHeight() - this.getY() - clickedY > 1 ? resize.getY() - this.getY() - clickedY + resize.getHeight() : 1;
                             resize.setBounds( resize.getX(),
                                                           resize.getY() + resize.getHeight() - this.getY() - clickedY > 1 ? this.getY() + clickedY : resize.getY() + resize.getHeight() - 1,
                                                           width,
                                                           height );
                             break;
                        case E_RESIZE_BUTTON:
                             width = this.getX() + clickedX - resize.getX() > 1 ? this.getX() + clickedX - resize.getX() : 1;
                             resize.setBounds( resize.getX(),
                                                           resize.getY(),
                                                           width,
                                                           resize.getHeight() );
                             break;
                        case SE_RESIZE_BUTTON:
                             width = this.getX() + clickedX - resize.getX() > 1 ? this.getX() + clickedX - resize.getX() : 1;
                             height = this.getY() + clickedY - resize.getY() > 1 ? this.getY() + clickedY - resize.getY() : 1;
                             resize.setBounds( resize.getX(),
                                                           resize.getY(),
                                                           width,
                                                           height );
                             break;
                        case S_RESIZE_BUTTON:
                             height = this.getY() + clickedY - resize.getY() > 1 ? this.getY() + clickedY - resize.getY() : 1;
                             resize.setBounds( resize.getX(),
                                                           resize.getY(),
                                                           resize.getWidth(),
                                                           height );
                             break;
                        case SW_RESIZE_BUTTON:
                             width = resize.getX() + resize.getWidth() - this.getX() - clickedX > 1 ? resize.getX() - this.getX() - clickedX + resize.getWidth() : 1;
                             height = this.getY() + clickedY - resize.getY() > 1 ? this.getY() + clickedY - resize.getY() : 1;
                             resize.setBounds( resize.getX() + resize.getWidth() - this.getX() - clickedX > 1 ? this.getX() + clickedX : resize.getX() + resize.getWidth() - 1,
                                                           resize.getY(),
                                                           width,
                                                           height );
                             break;
                        case W_RESIZE_BUTTON:
                             width = resize.getX() + resize.getWidth() - this.getX() - clickedX > 1 ? resize.getX() - this.getX() - clickedX + resize.getWidth() : 1;
                             resize.setBounds( resize.getX() + resize.getWidth() - this.getX() - clickedX > 1 ? this.getX() + clickedX : resize.getX() + resize.getWidth() - 1,
                                                           resize.getY(),
                                                           width,
                                                           resize.getHeight() );
         public void setBounds()
              switch( buttonType )
                   case NW_RESIZE_BUTTON:
                        this.setBounds( resize.getX() - 5,
                                                 resize.getY() - 5,
                                                 5,
                                                 5 );
                        break;
                   case N_RESIZE_BUTTON:
                        this.setBounds( (int)( ( resize.getWidth() + 2 * resize.getX() ) / 2 ) - 2,
                                                 resize.getY() - 5,
                                                 5,
                                                 5 );
                        break;
                   case NE_RESIZE_BUTTON:
                        this.setBounds( resize.getWidth() + resize.getX(),
                                                 resize.getY() - 5,
                                                 5,
                                                 5 );
                        break;
                   case E_RESIZE_BUTTON:
                        this.setBounds( resize.getWidth() + resize.getX(),
                                                 (int)( ( resize.getHeight() + 2 * resize.getY() ) / 2 ) - 2,
                                                 5,
                                                 5 );
                        break;
                   case SE_RESIZE_BUTTON:
                        this.setBounds( resize.getWidth() + resize.getX(),
                                                 resize.getHeight() + resize.getY(),
                                                 5,
                                                 5 );
                        break;
                   case S_RESIZE_BUTTON:
                        this.setBounds( (int)( ( resize.getWidth() + 2 * resize.getX() ) / 2 ) - 2,
                                                 resize.getHeight() + resize.getY(),
                                                 5,
                                                 5 );
                        break;
                   case SW_RESIZE_BUTTON:
                        this.setBounds( resize.getX() - 5,
                                                 resize.getHeight() + resize.getY(),
                                                 5,
                                                 5 );
                        break;
                   case W_RESIZE_BUTTON:
                        this.setBounds( resize.getX() - 5,
                                                 (int)( ( resize.getHeight() + 2 * resize.getY() ) / 2 ) - 2,
                                                 5,
                                                 5 );
         public void componentHidden(ComponentEvent e)
         public void componentMoved(ComponentEvent e)
         public void componentResized(ComponentEvent e)
              this.setBounds();
         public void componentShown(ComponentEvent e)
         public void setEnabled( boolean enable )
              enabled = enable;
         public boolean isEnabled()
              return enabled;
         public void paint( Graphics g )
              ( (Graphics2D)g ).fillRect( 0, 0, 5, 5 );
    }

    Hi bbritta,
    Thanks for the time. I guess the setLocation MIGHT be off, tho ideally, it should place the tv somewhere near the right bottom corner of the screen.
    The basic requirement I have is in the code written. This is what I want. When I start my application, I want the small tv screen only to appear, with the two colored panels (that shall obviously contain some other code). When my mouse hovers on this small screen, the buttons should appear in a panel just below the small screen. So I have used a JLayered pane that displays two separate gifs, one for the small screen, and one for the buttons panel. On the small screen gif, I have added two panels to layer 1, and on the button panel gif, I have added 3 buttons.
    What is happening is that if I set the frame size to the size of the small screen at startup (before show()), then on mouse hover, the frame size increases, but the layered pane size stays the same, and hence i cannot see the button panel. But if I start out with the button panel showing (frame size initially set to the larger value), then on mouse exit, the button panel disappears, and reappears properly on mouse enter. But I don't want to set the original size to the larger value, since only the small screen must be seen first.
    Did I make my self clear? The whole problem is that on mouse hover, u cannot see the button panel, till u change the setSize() code in initializeFrame() to use c_o_FULL_TV_SIZE instead of c_o_TV_SIZE. That u cannot see the buttons IS my problem!
    Thanks,
    Shefali.

  • Resizing problem

    Hello!
    I have a JFrame that contains some components I would rather didn't shrink below a minimum size, which I have specified using setMinimumSize. Everything works fine if I have te following line in my code:         JFrame.setDefaultLookAndFeelDecorated(true);If I remove it, though, in order to use the native look and feel, I have found the minimum size gets ignored completely. Currently, I am using a ComponentListener that watches for resizes and corrects them, however the results aren't very pretty.
    So my question is this: is there any better workaround to this problem, such as watching for (and ignoring) mouse clicks on the border of the Jframe?
    Many thanks in advance!

    It's very stupid if you answer a question and find
    then that it has been answered hours ago.I meant: It's stupid (annoying) for me if
    I answer a question and find then that it has
    been answered hours ago.
    I have not referred the "stupid" to you.
    Don't want anyone here to feel offended.Even if you are stupid.

  • JTabbedPane, JPane PROBLEM

    Hi!, I have a several problem with JApplet, this is the code:
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.io.*;
    import java.awt.*;
    public class NuevoApplet extends JApplet{
    JMenuBar menuBar;
    JMenu menuArchivo, submenu;
    JMenuItem menuNuevo;
    JTabbedPane Tabbed1 = new JTabbedPane();
    JPanel Panel = new JPanel();
    class EventHandler implements ActionListener
              public void actionPerformed(ActionEvent e)
                   //Si se elige salir en el menu
                   if (e.getSource() == menuNuevo)
                        CreaTab();
    ActionListener eventHandler = new EventHandler();
    public void start(){}
    public void init () {
    try {
    UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
    } catch (Exception e) { }
    Panel.setBorder(BorderFactory.createEtchedBorder());
    Panel.setLayout(new java.awt.BorderLayout());
    this.Panel.updateUI();
    this.setContentPane(this.Panel);
    this.CreaMenus();
    this.getContentPane().add(this.Tabbed1,java.awt.BorderLayout.CENTER);
    initConnections();
    private void CreaMenus(){
    //Creamos la barra de men�s
    menuBar = new JMenuBar();
    this.setJMenuBar(menuBar);
    //Creamos el men� de Archivo
    menuArchivo = new JMenu("Archivo");
    menuBar.add(menuArchivo);
    //Creamos los elementos del men� archivo
    menuNuevo = new JMenuItem("Abrir Archivo *.hex");
    menuArchivo.add(menuNuevo);     
    public void initConnections()
    //se suscriben todas las componentes que quieren escuchar los eventos
         menuNuevo.addActionListener(eventHandler);
    public void CreaTab(){
    JPanel a = new JPanel();
    Entorno1 b = new Entorno1();
    a.add(new JButton("BOTON1"),java.awt.BorderLayout.CENTER);
    a.add(new JButton("BOTON2"),java.awt.BorderLayout.EAST);
    this.Tabbed1.addTab("Primera Pesta�a", b); --> PROBLEM, not insert the JPanel b extends Entorno1
         b.repaint();
         Tabbed1.invalidate();
    Tabbed1.getParent().invalidate();
    Tabbed1.validate();
    Tabbed1.repaint();
         this.Tabbed1.updateUI();
         /*this.Tabbed1.validate();
         this.Tabbed1.updateUI();
         this.Tabbed1.revalidate();*/
    public class Entorno1 extends JPanel{
    public void Entorno1(){
         setLayout(new BorderLayout());
         Border raisedBevel = BorderFactory.createRaisedBevelBorder();
    Border loweredBevel = BorderFactory.createLoweredBevelBorder();
    Border compound = BorderFactory.createCompoundBorder
    (raisedBevel, loweredBevel);
    this.setBorder(compound);
    this.add(new JButton("Boton1"),java.awt.BorderLayout.CENTER);
    this.add(new JButton("Boton2"),java.awt.BorderLayout.EAST);
    this.updateUI();
    this.setVisible(true);
    this.revalidate();
    this.repaint();
    } //Fin de la clase Applet16F84
    When I use b extends Entorno1 and I insert as JPanel of JTabbedPane, not show it.
    this.Tabbed1.addTab("Primera Pesta�a", b);
    But this yes show it:
    this.Tabbed1.addTab("Primera Pesta�a", a);
    Why ? ..
    Thanks !

    Your constructor is actually a method and not a constructor.
    Therefore calling new Entorno1() returns you a blank panel.
    change this
    public void Entorno1(){
    ...to this.
    public Entorno1(){that should do it..
    nes

  • Flash plugin window resize problem

    When i try to resize non-maximized window with this page, firefox not let me do this. I tried on other browsers works fine, but firefox just cancel resize operation and change it's size only on 1-3 pixels.
    [http://armsenergy.com/as3/forFirefox/index.php back up'd example]

    Try to "disable the hardware acceleration" in the Flash Player.
    *http://helpx.adobe.com/flash-player/kb/video-playback-issues.html
    See also:
    *https://support.mozilla.org/kb/keep-flash-up-to-date-and-troubleshoot-problems
    Flash "Display settings" window:
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html
    You can check for problems caused by a recent Flash 11.3 update and possibly downgrade to Flash 11.2 or 10.3.
    *https://support.mozilla.org/kb/flash-113-doesnt-load-video-firefox
    *https://support.mozilla.org/kb/flash-113-crashes

Maybe you are looking for

  • How to display the steps of a sort algorithm??

    I'm having a lot of trouble trying to display the results of applying a merge sort to a set of 10 integers. The problem is not that I can't see anything on the text area within the applet, the problem is that I am getting a lot of repetitions and dup

  • No ability to create PDF Files using Acrobat 6.01_6.06 after installing Word 2010. (Windows XP)

    Since installing Word 2010 (upgrading from Word 2003) there are no visable PDF Icons nor ability to create PDF Files using Adobe Acrobat 6.06.  Operating system is Windows XP.  Browser is IE8.  Various attempts to bypass this situation have not been

  • Audio output via firewire

    I can not get audio working through firewire on my late 2013 MacBook Pro 13". If I test channels in channel setup it gives me static, but if I play iTunes od Spybot nothing happens. Internal speakers work fine. Any ideas what to do?

  • How to add new item in more options dialog box

    Hi all, Can anyone tell me how to add new item in more options dialog box(site actions -> more options). I want to add new item there to the new page layout which I created but I didn't find any way to do it. can anyone assist me for this.

  • IPhone 1st generation question

    When iphones update to the 3.0 for picture messaging and etc. do first generation iphones still not have picture messaging because mine doesnt and im still using my email for sending pictures.