Internal JFrames Programming Software Development by ExtraKanin …the reason why I wanted to make internal JFrames is that I'm using layout managers on… //primarypanel primaryPanel.add(btnsPanel); //add panels to internal jframes secondaryInternalFr.add(secondaryPanel); primaryInternalFr.add(primaryPanel); //set the sizes… Re: Internal JFrames Programming Software Development by stultuske define "doesn't run". does it give you a stacktrace, or does it just not run? I tried your code here. you get NullPointerExceptions, because you don't instantiate your 'internal JFrames' which are actually just JFrames, not internal jframes. start with instantiating those. Re: Internal JFrames Programming Software Development by JamesCherrill There's no reason at all to use JFrames like that. (In fact it's not even legal to … Linking Multiple JFrames Programming Software Development by LondonJava I have four JFrames open in an application. I wish for one of them to be the base JFrame, and when one of the others is closed than everything except the base frame will dispose. How do I link the other three JFrames so that when any one of them is closed (disposed) they all close? Re: Killing n JFrames Programming Software Development by Xhamolk_ … JFrame. First of all, if you need to know which JFrames are the ones you want to hide. You may implement… here. list.get( index ).setVisible( false ); } /** * "Kills" the JFrames #3, #4 and #6 */ public static void main(String[] args… Re: Linking Multiple JFrames Programming Software Development by hfx642 What I would do is... One JFrame (your base frame) and 3 JDialogs. I think that this would be easier to implement than 4 JFrames. Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by TheWhite … trying to create a JButton in 1 of my 2 JFrames which exits the top or current JFrame... If I try… Killing n JFrames Programming Software Development by suncica2222 I have array of 10 JFrames instanced and I want to kill 3 or 5 or … Re: Killing n JFrames Programming Software Development by suncica2222 … really big constructor that creates and destroys and control the JFrames whit his big list of input parametars,like this: [CODE… Re: Killing n JFrames Programming Software Development by VernonDozier … or some other Collection (as opposed to an array) of JFrames. Deleting an element is easy. Just use ArrayList's [ICODE… Re: Killing n JFrames Programming Software Development by Xhamolk_ … or some other Collection (as opposed to an array) of JFrames. Deleting an element is easy. Just use ArrayList's [ICODE… Assistance with JFrames Programming Software Development by bobit …, I need some assistance with an assignment that deals with Jframes. The assignment says "For questions 27 to 31, consider… jframes Programming Software Development by game06 i can some one help me with jframe and panel. i want to create button using jpanel. i look online but they seem to have different ways to do it and i have no idea which is the best way to do this. ex some people extends jframe at top. other create jframe j = new jframe in main etc... This is what iam trying to do. dont worry about my logic here. … Re: jframes Programming Software Development by stultuske I hate it to say, but your code makes not very much sense to me. having all those classes extend JFrame, I mean. anyway, what exactly is it you try to understand yet don't get? Re: jframes Programming Software Development by sirlink99 Here is the general order of how you want to create a frame containing a panel containing a button first you want to create a [JFrame](http://docs.oracle.com/javase/6/docs/api/javax/swing/JFrame.html), [JPanel](http://docs.oracle.com/javase/6/docs/api/javax/swing/JPanel.html) and a [JButton](http://docs.oracle.com/javase/6/docs/api/javax/swing/… Re: jframes Programming Software Development by JamesCherrill Some people extend JFrame, others just create JFrame in the code. I see little reason to extend JFrame unless you want to call JFrame's methods (eg setVisible) from another class, but in real life it's never that simple anyway. You don't normally need to extend anything else for your panels, buttons etc unless you have to do something special like… Re: jframes Programming Software Development by pbj.codez Here is a [link](http://www.youtube.com/watch?v=3XB3in9Xqy8) to the beginning of a near 10 part video series on Swing, and developing GUIs in general.The author of this video series, is very well versed in what he is doing, and generally follows the best coding conventions. You may find his style to be up your alley. Feel free to check em' out. Re: Help! JApplet -> JFrames Programming Software Development by javaAddict Declare the variables in the class, instantiate them in the constructor. Read about JFrames. Also I put in the constructor the code that generates the gui. Then call the class from a main method JFrames As Objects: Running Methods Programming Software Development by ToXSiK Hey everyone, and thanks for taking the time to read my post. Basically, I have a JFrame called "loginPage", that, well, is a login page. If a user logs into this page with the correct credentials, a new JFrame object called accountDetails opens (Or is constructed). Now, Is there a way to make it so that when my code constructs the… Re: Linking Multiple JFrames Programming Software Development by Ezzaral Keep a List of the dependent frames in your base frame. When closing one of the dependents, call a method on the base to dispose of all dependents. Re: Linking Multiple JFrames Programming Software Development by mKorbel 1) not possible, without huge code for AWT workaround 2) you are talking about JFrame#setDefaultCloseOperations(JFrame.EXIT_ON_CLOSE) with 3 JDialogs##setDefaultCloseOperations(JDilaog.DISPOSE_ON_CLOSE) 3) don't do it that this way its so hard job manage anything betweens four hight level container, you have to put there some hierarchy, result is… Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by Alex Edwards You'd need to create a button that has an actionListener that, upon activation, will access a reference to whichever pane is "focused" then you'll need to access that pane's window-hiding command (you'll have to pick the command that hides the window permanently to emulate a close). Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by TheWhite The way I have it set up: JFrame / JPanel - JButton \ JLabel - some painted text In the JButton's actionListener: getRootPane().getParent().setVisible(false); seems to hide the frame. It doesn't dispose of it though which means its still hanging there in memory right? No garbage collection? I guess it's not a big deal though... Not … Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by Ezzaral Just call [code]whateverFrame.dispose();[/code] in the action listener. Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by TheWhite ohhh.. I think I know why I didn't notice dispose() as a function... [code] public class Testing extends JFrame{ public static void main(String[] args){ Testing test = new Testing(); } public Testing(){ JButton ok = new JButton("OK"); ok.setMargin(new Insets(0,5,0,5)); ok.addActionListener(new ActionListener() … Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by Ezzaral "this" refers to the enclosing instance, which in your case above is an anonymous inner class that implements ActionListener. It's not a JFrame. If you drop the "this", or qualify is with "Test.this" it would work fine. Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by TheWhite ohhh... so what I just did was ActionListener.this.dispose() which obviously doesn't exist... When I did: [code].....(new ActionListener() { public void actionPerformed(ActionEvent ae) { ActionListener.this. } });[/code] I was no longer in the outer class, rather in the inner class which "this" now refers too.. Thanks … Re: Exiting 1 out of 2 JFrames using a JButton? Programming Software Development by Ezzaral "this" already refers to that inner class instance. You only need to qualify it if you want to refer to the enclosing class instance, like "Testing.this". Re: Killing n JFrames Programming Software Development by VernonDozier Java has a garbage collector. You don't need to destroy anything like you do in C++ with the [ICODE]delete[/ICODE] command. When it's no longer being used anywhere, Java will get rid of it. You can always set something to null. That means that you are done with the object. [code=JAVA] SomeObject object1 = new SomeObject (); object1.dostuff (); … Re: Killing n JFrames Programming Software Development by suncica2222 very nice explanation!!! it's so much clearer now !!! bravo!! My next question is how to count how much intanced objects you have at some moment???