Wrox Programmer Forums
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2007, 10:32 PM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default GUI chat room

[u]

i have to do the following:
write a Java program to implement the GUI for a chat program.The program should include components attached to a form: a text field, a pop-up choice-group and up to 8 string items which will be messages entered by the user. Users should be presented with two
commands, ‘Send’ and ‘Exit’.
Beneath the text field and user selection choice-group, there should always be no more than 8 string items, also identifying which user wrote which message. When a message is added to the group of messages, the text field should be erased ready for the next message. After 8 messages have been added to the group of messages, any additional messages are added to the end of the group and the first (oldest) message is removed. Another way to describe this is to
display only the last 8 messages entered.


Any ideas how to do this


</u>
 
Old September 1st, 2007, 10:32 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

wow what a lot of underlining.

Can we see what you have already?



--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
 
Old September 2nd, 2007, 02:19 AM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was able to do the part where the user is asked to enter the message and also i did the pop group choice option. But i am not able to get the SEND and EXIT commands to work.
Also how will i get the program to only register the last 8 messages and deletes the rest?

 
Old September 2nd, 2007, 02:53 AM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the code that i did so far.
Quote:
quote:
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeExcepti on;
import javax.microedition.lcdui.*;



public class MyOwnGUI extends MIDlet {

Display display=Display.getDisplay(this);


public MyOwnGUI() {


}

protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub

}

protected void pauseApp() {
// TODO Auto-generated method stub

}

protected void startApp() throws MIDletStateChangeException {


// TODO Auto-generated method stub
Form form = new Form("Chat GUI");

//command options
TextField textfield =new TextField("TEXT FIELD","",25,TextField.ANY);
form.append(textfield);
display.setCurrent(form);

//ChoiceGroup(label,type,elements,image)
ChoiceGroup CoursePOP = new ChoiceGroup ("Select user", Choice.POPUP,new String[] {"USER A", "USER B"}, null);
form.append(CoursePOP);
display.setCurrent(form);





}

}

 
Old October 30th, 2007, 04:46 AM
Registered User
 
Join Date: Oct 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jalaklenteng
Default

can someone help me solve this problem?!?

Project
This project consists of writing a Java application that sorts input data.
The program will perform the following steps:
Step 1. Read input from a screen – using GUI
Step 2. Sort the input. For example, if the input is a sequence (11,44,33,55,22), and descending order is selected then the sorted sequence will be (55,44,33,22,11). The user can choose either to sort in descending or ascending order.
For example, if the input sequence is
  4 2 9 3 5 6 7 8 10 11 1 12 14 13
then the screen will display the following information:
Data Structure: Array / Linked Chain
Sorting Algorithm: (whatever algorithm – taught in class)
Order : Ascending / Descending
Numbers Read In: 14

Input Sequence:
     4 2 9 3 5 6 7 8 10 11
     1 12 14 13

Sorted Sequence:
    14 13 12 11 10 9 8 7 6 5
     4 3 2 1







Similar Threads
Thread Thread Starter Forum Replies Last Post
Chat Room aliusmankhan ASP.NET 2.0 Professional 2 August 23rd, 2008 07:51 AM
help in GUI khfarooq Java GUI 5 August 22nd, 2004 05:00 AM
Online Chat Room pro-logic .NET Web Services 0 October 20th, 2003 05:26 AM
Chat Room Creation HELP! nvillare Classic ASP Basics 2 August 28th, 2003 06:46 AM
Chat Room Trouble nvillare Classic ASP Basics 0 July 11th, 2003 03:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.