Solved

How to best design the UI?

Posted on 2003-11-18
9
291 Views
Last Modified: 2011-04-14
Hi all..

I have a project and I really need your help..


This program is to help the action desk handle complaints..

The first user interface will allow its user to specify his position..it will have two buttons (manager/employee)..

when the employee click on employee..an interface will appear and the employee will have to specify his name, id, and the problem details..he will also choose the complaint type (software/hardware) [two radio buttons]..and then send it to the manager by clicking [send] button..

After that the manager will enter his window..and he will have a list of technicians names to assign each compalint to a technician using automatic complaint number..
also the manager will be able to see (number, id, type, technicain name, date and status) for each complaint..and specify details

The program will have to show the date and calculate complaint number automatically..

Im thinking of having two lists..the manager will choose the complaint number from the first one..and choose a technician name to assign..and then all the other information will appear in a text area..

I want to ask about the best way in which I could design the manager interface and its different options..How will the manager be able to choose a complaint number, assign a technician to it..and show all the mentioned information..


Is there any other better way..? and how can I calculate the complaint number and date automatically?


waiting..and sorry if the question is too long

0
Comment
Question by:swet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9771776
You could actually handle the interface changing, (from manager to employee and back,) using a drop-down box with three choices:

Select Role
Employee
Manager

And then in a separate JPanel, you could populate the inputs of a manager and an employee pane based upone the valueChanged() event which gets spawned every time the value of the drop-down box changes.  The only trick is that you'd probably want to eliminate the "Select Role" option the moment they select one of the roles, or at least ignore it when the valueChanged() event shoots off.

As for the two lists, I'd also reccoment a drop down box.  It's small, succinct, and easy to dynamically populate, which will be good once technicians join and leave the company.  You can keep the list of them in a database, for example.

Speaking of databases, I assume you're using one to store the Action Desk complaints.  In that case, you can just create a column that automatically increments a number for you to designate the complaint number.

The last issue is the date.  That's actually trivial.  Just look up in the API java.util.Calendar.  The code to generate a date looks like this, more or less, depending on what format you want:

Calendar now = Calendar.newInstance();
int year = now.get( Calendar.YEAR );
int month = now.get( Calendar.MONTH );
int day = now.get( Calendar.DAY );

System.out.println( "Date is:\t" + month + "/" + day + "/" + year );
0
 

Author Comment

by:swet
ID: 9771840
thanks very much..

but can you help me with some simple codes to use the drop-down box?

what do I have to do..Do I have to create three classes or only one..

I'm afriad I can't do it :(

and what is more..is that we havn't studied data bases yet..My teacher advised me to use vector..but Im still confused..


waiting to hear from you...

0
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9771859
Ah.  I just found it.  You want to register your Drop-Down List, ( with Select Role, Employee, and Manager, ) with the Listener Interface:

ListSelectionListener

It has the one method:

valueChanged( ListSelectionEvent e )

Usually you actually have to register the Listener with your list's ListSelectionModel, which is easy enough to get:

ListSelectionModel myModel = myList.getSelectionModel();
myModel.addListSelectionListener( myListener );
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:swet
ID: 9771889

So..when I will start my project..how many interfaces will I need..Will I need one for the drop down box, one for the manager, and one for the employee?

when I will select from the list say Manager..what will happened..will another window appear?

thanks in advance
0
 
LVL 2

Accepted Solution

by:
SuperKarateMonkey earned 120 total points
ID: 9771970
Ah, I see where your skill level is now:

OK, first of all, bookmark this web page:

http://java.sun.com/j2se/1.4.2/docs/api/

You should consider this the Holy Grail of java reference.  It has EVERY class you could ever worry about, and every method of every class.  This assumes you're working in J2SDK 1.4.2, of course, (you can see from the URL.)  If you're using a different JDK, just alter the URL, so if you're using 1.3.1, then make your URL:

http://java.sun.com/j2se/1.3.1/docs/api/

etc. etc. etc...

Now, I'm not going to write your code for you, (this is class, you need to learn for yourself,) but I'll skeleton it out, which should provide some help.  Assuming you're using swing to create your GUI, you'll need to work with the javax.swing package:

1.  Create a JFrame

2.  Create 2 JPanels, add them to the JFrame, a small one, (30% of the JFrame,) on the left, and the bigger one on the right.

3.  Create a JList to add to the first JPanel on the left.  There are a 4 constructors.  Use the one:

JList( Vector listData )

A Vector is like an array, only it's resizable, and will automatically resize itself when you add more objects to it.  So you work with a vector like this:

Vector v = new Vector();
v.add( "Four" );
v.add( "Score" );
v.add( "And" );
v.add( "Seven" );
v.add( "Years" );
v.add( "Ago..." );

for( int i = 0; i < v.size(); i++ )
{
  System.out.println( (String)(v.get(i)) + " " );
}

This would print out:

Four Score And Seven Years Ago...

Anyway, that's a bit of overkill.  Point is, you can dynamically resize a Vector.

4.  Get the ListSelectionModel from the JList, register the ListSelectionListener to it.

5.  For the listener, write the code to populate the right hand JPanel whenever the valueChanged event fires off, with AI to determine what the resultant value is.  You might want to ignore the change if it returns to "Select One," or you might want to simply delete "Select One" from the list the first time the list changes, since at that point they've picked a horse.

That's about it for the skeleton code.  That should be enough for your to get started.

You might also want to look in the Sun's Swing Tutorial, located at:

http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

Good luck.
0
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9772015
As for your specific questions, you need to be careful with terminology.  I'm not sure what you mean by "interfaces."  It doesn't sound like you're referring to the java definition of an interface, but rather UI components, (which is what you should call them:  UI Components.)

You'll need two completely separate routines to create the two UI's, one for the manager part and one for the employee part.  Probably the best way to handle that is to create them both, and add them both to two different JPanels, (making for a total of three:  The selector panel, the manager panel, and the employee panel.)  Then, when the selection of the list changes, you can just add the JPanel wholesale to the section on the right.  If it changes again, you just remove the entire panel that's currently there, and add the other one.  You'll need to explicitly keep track of which one is added, so that when you submit your data it doesn't use values from an irrelevant JPanel Component, but that's easily enough done.
0
 

Author Comment

by:swet
ID: 9772016

thanks alot..

as you see..I'm just a begginer..

your explaination has helped me alot..

but I have a question..Do you mean that when I choose say (manager) from the left list..the right panel will show me the options of the manager?
0
 

Author Comment

by:swet
ID: 9772038

Oh..thanks alot..

now I will try doing it :)
0
 
LVL 2

Expert Comment

by:SuperKarateMonkey
ID: 9772061
OK.  Don't forget to close out the question when you finish, and good luck. :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Facing this issue for maven proxy setting 2 27
Selenium docs api java index 3 68
Eclipse Java import and method not resolved 4 81
spring maven example issues 3 43
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question