• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

I have 3 midlets but code to be displayed should be in first midlet .

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have 3 midlets but code to be displayed should be in first midlet . but in the emulator all the names of 3 midlets are being displayed how should code be to interlink the 3 midlets
 
Ranch Hand
Posts: 1906
3
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If three are showing up, it's because you've put all three into the descriptor files. (Which is where, i believe, the implementation gets the names.) What are yo utrying to accomplish, so we might better help you?
 
anu rani
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will send you the three programs please tell me correct way in the progarms data1 data are the jsp programs in which i wrote databse conenction
LoginMidlet
package MIDlets;
import java.io.*;
import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;

public class LoginMidlet extends MIDlet implements CommandListener
{
private Display display;
private TextField userName;
private TextField password;
private Form form;
private Command cancel;
private Command login;
private Validate objMenu;


public LoginMidlet() throws Exception
{
userName = new TextField("LoginID:", "", 10, TextField.ANY);
password = new TextField("Password:", "", 10, TextField.PASSWORD);
form = new Form("Sign in");
cancel = new Command("Cancel", Command.CANCEL, 2);
login = new Command("Login", Command.OK, 2);
}

public void startApp()
{

display = Display.getDisplay(this);
form.append(userName);
form.append(password);
form.addCommand(cancel);
form.addCommand(login);
form.setCommandListener(this);
display.setCurrent(form);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
notifyDestroyed();
}

public void validateUser(String Password)
{
objMenu = new Validate();
if(password.equals("ProvPassword"))
{
objMenu.menu(display);
} else {
tryAgain();
}
}

public void tryAgain() {
Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR);
error.setTimeout(Alert.FOREVER);
userName.setString("");
password.setString("");
display.setCurrent(error, form);
}

public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("Cancel")) {
destroyApp(true);
} else if(label.equals("Login")) {
validateUser(password.getString());
}
}
}

Valiadte package MIDlets;

import java.io.*;
import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;

public class Validate extends MIDlet implements CommandListener {
private complaint objcomplaintRequest;
Display display;
private String getURL="http://localhost/jspprograms/data.jsp?userName=ProvID&password=ProvPassword";

public void menu(Display display) {

this.display=display;
List services = new List("Choose one", Choice.EXCLUSIVE);
services.append("Your request/Response", null);
services.append("Sign Out", null);
services.setCommandListener(this);
display.setCurrent(services);

}


public void startApp()
{

try {

HttpConnection conn = (HttpConnection) Connector.open(getURL);
conn.setRequestMethod(HttpConnection.POST);
conn.close();

} catch (Exception e) {
System.out.println(e.getMessage());
}
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}



public void commandAction(Command c, Displayable d) {
objcomplaintRequest=new complaint();
String label = c.getLabel();
if(label.equals("Your request/Response")) {
objcomplaintRequest.complaint();
} else if(label.equals("Sign Out")) {
destroyApp(true);


}
}
}
compalint
package MIDlets;

import java.io.*;
import java.util.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
class complaint
{

private String getURL="http://localhost/jspprograms/data1.jsp";
public void startApp() {

try {

HttpConnection conn = (HttpConnection) Connector.open(getURL);
conn.setRequestMethod(HttpConnection.POST);
conn.close();

} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}



}

one error is comingProject "LoginMidlet" loaded
Settings updated
Project settings saved
Project settings saved
Building "LoginMidlet"
C:\WTK25\apps\LoginMidlet\src\Validate.java:52: cannot find symbol
symbol : method complaint()
location: class MIDlets.complaint
objcomplaintRequest.complaint();
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic