0

I have created a java JFrameForm, it serves as a login form. Once it validates one's login I wish it to redirect to another JFrameForm and close itself. Essentially, I have read around a bit, and all the info says you use the existing JFrameForm as a stub to launch a new applet form but I don't want this?

Can someone please give me some example code in order to launch my JFrameForm (named PostAccess.java) from within my existing JFrameForm? I would also like the original JFrameForm to close if this is possible?

tshepang
  • 12,111
  • 21
  • 91
  • 136
  • 1
    There is no such animal as a "JFrameForm". Note that this has been asked a lot, and the solutions are easy to find, so there's no need to have anyone post new code for this. Simply use a JDialog for the dependent dialog. – Hovercraft Full Of Eels Mar 29 '13 at 01:00
  • I tried that? I have the code fully working with dialog's, but it looks terrible! I am sure there must be a way. And is that not the correct name for them? I know they are java files, but NetbeansIDE calls them JFrameForm's? – Liam Pufferfish Mar 29 '13 at 01:03
  • 1
    If you have problems with your code, post it, and we can help you fix it. NetBeans helps you create different GUI components, but it would ultimately be a JFrame. But I recommend that you avoid having it create JFrames for you, and in fact recommend that you avoid using NetBeans generated code. Learn to code by hand, and you'll be glad you did. – Hovercraft Full Of Eels Mar 29 '13 at 01:05
  • Look, I know, I wrote the code entirely by myself (with dialogs), using notepad, but it looks visually very bad, I understand what you mean, but in the end, it's the looks that matter to "PEOPLE", so I really can't just use dialog's, as it, well, sucks... But I understand about coding with Java by hand, I know, if you can't code it without an IDE, you can't code it! – Liam Pufferfish Mar 29 '13 at 01:07
  • 1
    IMHO what an incredibly arrogant and short sighted thing to say. I'd be like saying if you can't code in assembler then you can't code. A good developer uses the tools that are available to them to improve their ability to achieve the results they need to in the best time they can. Good on you for living in the 90s. If your coding an applet, you shouldn't be opening any additional frames anyway, it breaks the design of the applet. Instead you should be using something like a JTabbedPane or CardLayout to allow you to change the views – MadProgrammer Mar 29 '13 at 01:25
  • 1
    Netbeans doesn't call anything JFrameForms. It treats all Swong/AWT containers as forms (this is a term that has been used for years). Netbeans still treats a JFrame as a JFrame and calls it as such – MadProgrammer Mar 29 '13 at 01:28
  • Well, if you right click on a package, hover over new new, it shows you the option JFrameForm, thus the name I derived? – Liam Pufferfish Mar 29 '13 at 01:31
  • It's actually "JFrame Form" and "JPanel Form", similar Netbeans shows "Java Class", but it's still a Class – MadProgrammer Mar 29 '13 at 02:24
  • See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) – Andrew Thompson Mar 29 '13 at 22:51

1 Answers1

0

try this

new PostAccess().setVisible(true); dispose();

kostad
  • 3
  • 4