Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 26th, 2013, 03:28 PM
lo22 lo22 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 7 lo22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 47 sec
Reputation Power: 0
How to make this GUI window

Hi there

I have an assignment where I have to make a phone list GUI, and the main window of that GUI, will have to look like this:



So I have tried with all kinds of layout, but have not succeeded really. Especially I have a hard time placing the button and adding the JList window.

So could anyone please help on how to code this??

Reply With Quote
  #2  
Old February 26th, 2013, 03:48 PM
Aurum84 Aurum84 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 74 Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 23 h 5 m 49 sec
Reputation Power: 17
Please show your current code

Reply With Quote
  #3  
Old February 27th, 2013, 02:08 PM
lo22 lo22 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 7 lo22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 47 sec
Reputation Power: 0
Here is my source code:

Code:
public class PhoneListGUI implements ActionListener{
 
    JFrame guiFrame;
    JPanel buttonPanel;
    JButton button;
    JList list;
    
    public PhoneListGUI() {
	
        guiFrame = new JFrame();
        
        //make sure the program exits when the frame closes
        guiFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        guiFrame.setTitle("Phone List");
        guiFrame.setSize(300,300);
      
        
        //This will center the JFrame in the middle of the screen
        guiFrame.setLocationRelativeTo(null);

        Container contentPane = guiFrame.getContentPane();      
        contentPane.setLayout(new BorderLayout());
        

        JPanel buttonPanel = new JPanel();
      
        JButton newButton = new JButton("New Number");
        buttonPanel.add(newButton);
        JButton delButton = new JButton("Delete Number");
      	buttonPanel.add(delButton);
      

      	JButton exitButton = new JButton("Exit");
      	buttonPanel.add(exitButton);
   
        list = new JList<>();
          
        contentPane.add(buttonPanel, BorderLayout.WEST);
        contentPane.add(list, BorderLayout.EAST);

        guiFrame.setVisible(true);
    }

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
	}
}


It seems the JList is not really displayed... I have a main where I create an instance of PhoneListGUI.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > How to make this GUI window

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap