0

I am trying to get a userinterface page to display correctly on my page. It has to display a certain way on the screen but I cant get the correct Lay out to show up. Any suggestions or Help?! I've tried many things but Java can get a bit confusing. ATTACHED IS A LINK FOR IMAGE OF HOW ITS SUPPOSED TO LOOK

https://courses.eas.asu.edu/cse205/current/assignments/assignment6/assignment6.html

  public CreatePanel(Vector accountList, TransferPanel tPanel)
    {
   this.accountList = accountList;
   this.transferPanel = tPanel;



     JLabel label1 =new JLabel("Account ID: ");
     JLabel label2 = new JLabel("Amount: ");
     JTextField field1 = new JTextField();
     field1.setPreferredSize(new Dimension(250,70));
     JTextField field2 = new JTextField();
     field2.setPreferredSize(new Dimension(250,70));
     button1 = new JButton("Create an Account");
     JTextArea textArea = new JTextArea();
      textArea.setPreferredSize(new Dimension(500, 600));
      textArea.append("No account");
      textArea.setEditable(true);


      JPanel panel1 = new JPanel();
      panel1.setLayout(new GridLayout(3,3));
      panel1.add(label1);

      panel1.add(field1);

       panel1.add(label2);

       panel1.add(field2);



       JPanel panel2 = new JPanel();
      panel2.setLayout(new BorderLayout());
      panel2.add(button1, BorderLayout.SOUTH);



      JPanel panel3 = new JPanel();
      panel3.setLayout(new BorderLayout());
      panel3.add(textArea, BorderLayout.WEST);




     add(panel1);

     add(panel3);
     add(panel2);

  //ActionListener listener = new ButtonListener();
 //button1.addActionListener(listener);





    }
mKorbel
  • 109,525
  • 20
  • 134
  • 319
  • Your tasks seems to be to write an `applet`. You can start your education here: http://docs.oracle.com/javase/tutorial/deployment/applet/ – PM 77-1 Oct 04 '13 at 23:14
  • 1
    this assignment is overdue – Reimeus Oct 04 '13 at 23:15
  • 1
    http://docs.oracle.com/javase/tutorial/uiswing/layout/layoutlist.html – porfiriopartida Oct 04 '13 at 23:19
  • possible duplicate of [Layout managers to set this specific layout in java](http://stackoverflow.com/questions/19124739/layout-managers-to-set-this-specific-layout-in-java) – Andrew Thompson Oct 05 '13 at 09:23
  • Please refer your instructor to [Why CS teachers should stop teaching Java applets](http://programmers.blogoverflow.com/2013/05/why-cs-teachers-should-stop-teaching-java-applets/). – Andrew Thompson Oct 05 '13 at 09:27

0 Answers0