0

I am developing an application which have the following windows

If the information entered in the windows are correct than only the user will be prompted with the windows in the above sequence. Now the customer has demanded me with this user interface.

Now I have to add all these windows in the last window format, with the specification's as the user will be allowed in the 2nd portion of the last image if the first information entered is correct.And the user when launches this app see the last image and can change the values as any time in the respective portions of the last window. I have coded it in Swing Java.I am new to Java. I am working in Netbeans 7.1.2 I have three files as 1)Login.java -containing my LoginDemo class which have main and form object of extended Jframe class -Login class extending J frame and implementing action listener(this class creates an J frame of next file Enter the information. 2)Algorithm.java creates new J frame object of next file if information is correct. 3)TravellingSalesmanProblem.java gives the output as shown in Optimal Travel Route window. I am accessing the information using REST call to a website. So can anyone help me in this?

shalini
  • 145
  • 3
  • 14
  • 3
    See [this answer](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice/9554657#9554657) and the two links to other answers. Or alternately, it seems this needs a [Nested Layout](http://stackoverflow.com/a/5630271/418556). – Andrew Thompson Jul 07 '12 at 09:50
  • Also, try to add some gaps between the components and the outer border. Something like: `((JPanel) frame.getContentPane()).setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));` – Eng.Fouad Jul 07 '12 at 10:00
  • @Eng.Fouad where should I add these? – shalini Jul 07 '12 at 10:48
  • @user1500569: Please edit your question to include an [sscce](http://sscce.org/) that shows what you've [tried](http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html). – trashgod Jul 07 '12 at 11:57
  • @trashgod do I need to completely change my code.? I have taken weeks to get such an output and now I am required to change it. – shalini Jul 07 '12 at 12:47
  • I don't know; I haven't seen your code. One hopes you haven't spent weeks doing it wrong. e.g. `setLayout(null)`. An [sscce](http://sscce.org/) is a prototype that focuses on a particular aspect of a problem. It's an étude, rather than a symphony. – trashgod Jul 07 '12 at 17:24

1 Answers1

0

This will depend on how you structured you code. If you simply placed components directly onto the the windows/frames themselves, then you might be in for some work.

Alternatively, if you used panels, which you then placed onto windows, this might save you some time.

Anyway. Assuming you only have windows.

for each window do
    myLastWindow.add(window.getContentPane());

This is pretty simple, but you'll also need to know the layout you want. I'd suggest something like GridLayout or VerticalLayout from the SwingX project.

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366