Results 1 to 2 of 2

Thread: Maximized Selected InternalFrame

  1. #1

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552

    Maximized Selected InternalFrame

    Can't seem to get it to work. I'm sorry if this sounds like a newbie question. Here is my form class which just show and [supposed to, but not doing it] maximize Internal Frame.
    Code:
    import javax.swing.*;
    public class form {
    	
    	public static void showform(String title,
    			JInternalFrame child,
    			JDesktopPane parent){
    		
    		for(int i=0;i<parent.getAllFrames().length;i++){
    			JInternalFrame f=parent.getAllFrames()[i];
    			if(f.getName().equals(title)){
    				try{
    					f.setMaximum(true);
    					f.setSelected(true);
    				}
    				catch(Exception ex){
    					JOptionPane.showMessageDialog(child,ex.getMessage());
    				}
    				return;
    			}
    		}
    		parent.add(child);
    		try{
    			child.setMaximum(true);
    			child.setSelected(true);
    		}
    		catch(Exception ex){
    			JOptionPane.showMessageDialog(null,ex.getMessage());
    		}
    	}
    }
    and some use
    Code:
    	void mnunatureofcollectionlist_actionPerformed(ActionEvent e){
    		form.showform("frmnatureofcollectionlist",new frmnatureofcollectionlist(),desktop);
    	}
    Any suggestion? Thank you very much.

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Maximized Selected InternalFrame

    I thought you were suppose to throw a PropertyVetoExcetion when using maximize. If not, you can do it anyway and see if the problem is simply that the internal frame is rejecting the maximize property. I did read were some look and feels don't support the maximize property of the internal frame, but who knows.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width