project in java

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 3739 Views - Last Post: 19 November 2010 - 07:10 AM

#1 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

project in java

Posted 17 November 2010 - 08:16 AM

hello sir i am the final year student of b.c.s we have to do a project in java sir i nave found the idea that what to do in the project my project idea is "PC control by using mobile " sir i am not very much familiar about java but i have done coding that is the web cam that show mobile pictures in PC but it show the screen on PC it don't show the images
second thing i have to ask that i want to enhance this project that it will control PC by mobile what i have to do more things in coding? sir please tell me please reply this

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: project in java

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12324
  • View blog
  • Posts: 45,424
  • Joined: 27-December 08

Re: project in java

Posted 17 November 2010 - 08:32 AM

Take a look at the Process and Runtime classes for running commands on the System.
Was This Post Helpful? 0
  • +
  • -

#3 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 17 November 2010 - 08:44 AM

sir i check every thing nothing it happen
sir also tell about how to enhance the project that it will control PC by mobile sir please reply
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12324
  • View blog
  • Posts: 45,424
  • Joined: 27-December 08

Re: project in java

Posted 17 November 2010 - 09:02 AM

Post your code in the body of your thread using code tags, like so: :code:.

Also, please specifically describe your problems or errors.
Was This Post Helpful? 0
  • +
  • -

#5 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 17 November 2010 - 09:36 AM

i have attach the file above sir
i have 2 problems is that

1 is that it is a web cam project it show the pictures on PC of mobile but it show only white screen on PC not pictures

2 is that i want to enhance the project that it will control PC by mobile as a remote control sur please reply
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12324
  • View blog
  • Posts: 45,424
  • Joined: 27-December 08

Re: project in java

Posted 17 November 2010 - 09:41 AM

We would prefer you post your code in the body of your post using code tags.

1) You can use the Robot class on the client side to take a screenshot. Probably best practice to send it to a Servlet, and have the mobile device retrieve the image from the Servlet.

2) Did you try using the Process and Runtime classes? If so, what problems or errors are you experiencing when using them?
Was This Post Helpful? 0
  • +
  • -

#7 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 17 November 2010 - 09:55 AM

sir you are saying robot class so what statement i have to add kindly explain
secondly you are saying about run time classes and process it showing the same thing i don't have any error in the project it showing the white screen not pictures

sir please tell about how can i enhance the project? i want to add more features that it will control PC by mobile

sir please reply
Was This Post Helpful? -3
  • +
  • -

#8 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12324
  • View blog
  • Posts: 45,424
  • Joined: 27-December 08

Re: project in java

Posted 17 November 2010 - 10:03 AM

1) See the Robot createScreenCapture() method

2) The Process and Runtime classes will allow you to run commands on your computer.

Also, you still haven't posted any code. Please post your code in the body of your post using code tags, like so: :code:.
Was This Post Helpful? 0
  • +
  • -

#9 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 18 November 2010 - 12:58 AM

             import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;

import javax.bluetooth.*;
import javax.imageio.ImageIO;
import javax.microedition.io.*;
import javax.swing.*;



public class conSerialPort{

	static StreamConnectionNotifier notifier;
	static StreamConnection con = null;
	static LocalDevice localdevice = null;
	static ServiceRecord servicerecord = null;

	static UUID uuidSet = new UUID("100000",true);
	static String url = "btspp://localhost:"+uuidSet+";name=bitiserial";

	static InputStream in;
	static OutputStream out = null;

	static int j=0;

	static Object lock = new Object();

	static JTextArea jta;
	static JLabel jl1,jl2,jl3,jl4,jl5,jl6,jl7,jl8,jl9,jl10,jl11,jl12;

	static JPanel jp;
	static ImagePanel imgpanel = null;
	static JFrame fr;

	static JProgressBar jpb1;

	void bluetoothConnection()
	{
		Thread t = new Thread()
		{

		public void run()
		{
			try
			{
				localdevice = LocalDevice.getLocalDevice();//obtain reference to singleton
				localdevice.setDiscoverable(DiscoveryAgent.GIAC);

				jl1.setText(localdevice.getBluetoothAddress());
				jl2.setText(localdevice.getFriendlyName());

				//connection open ,it will also generate a ServiceRecord
				notifier = (StreamConnectionNotifier)Connector.open(url);


				servicerecord = localdevice.getRecord(notifier);

				DataElement elm = null;

				/*
				* Set public browse root in browsegrouplist, making service
				* public browseable
				*/
				/*elm = new DataElement(DataElement.DATSEQ);
				elm.addElement(new DataElement(DataElement.UUID,new UUID(0x1002)));
				servicerecord.setAttributeValue(0x0005,elm);
				*/
				/* Set service description */
				elm = new DataElement(DataElement.STRING,"Receiving jpeg images over RFCOMM");
				servicerecord.setAttributeValue(0x101,elm);

				/* Set service provider name */
				elm = new DataElement(
				DataElement.STRING,"Bishwajeet Communication Group");
				servicerecord.setAttributeValue(0x102,elm);

				/* Set serviceInfoTimeToLive */
				/*elm = new DataElement(DataElement.U_INT_4,10000);
				servicerecord.setAttributeValue(0x0007,elm);*/

				/* Set serviceAvailability */
				/*elm = new DataElement(DataElement.U_INT_1,255);
				servicerecord.setAttributeValue(0x0008,elm);*/

				/* Update the record, else changes are lost */
				try
				{
					localdevice.updateRecord(servicerecord);
				} catch (ServiceRegistrationException e3)
				{
					System.out.println("Service registration Update failed:"+e3);
				}

				DataElement serviceNameElement1 =servicerecord.getAttributeValue(0x0100);
			    String serviceName = (String)serviceNameElement1.getValue();
			    status("Service Name: "+serviceName);

			  /*  DataElement serviceNameElement2 =servicerecord.getAttributeValue(0x0005);
			    String uuidvalue = (String)serviceNameElement2.getValue();
			    f.jta.append("\nUUID VALUE: "+uuidvalue);*/

			    DataElement serviceNameElement3 =servicerecord.getAttributeValue(0x102);
			    String provider = (String)serviceNameElement3.getValue();
			    status("\nProvider: "+provider);


			    //status("\nNow, waiting for client.....");
			    jl9.setText("Waiting for client");

			    jpb1.setIndeterminate(true);

				try
				{
					//block the current thread until a client respond
					/*
					* Open the notifier. This is a blocking operation. Now the
					* ServiceRecord will be entered in the Bluetooth SDDB and
					* the server is ready for client connections.
					*/

					con = notifier.acceptAndOpen();
				}
				catch (ServiceRegistrationException sre)
				{
					System.out.println("Error creating service record");
				}

				//status("\nclient CONNECTED.....");
				jl9.setText("Connected");
				jpb1.setIndeterminate(false);

				/* A client has connected! Retrieve information about the
				* remote device and display it to the user.
				*/
				RemoteDevice dev = null;
				String name,address;
				boolean authorized = false;

					dev = RemoteDevice.getRemoteDevice(con);
					address = dev.getBluetoothAddress();
				try
				{
					name = dev.getFriendlyName(false);
					//authorized = dev.isAuthorized(con);
				} catch (IOException e) {
					name = "Unknown";
				}

				//status("\nDevice: "+address+" ("+name+")");//\nAuthorized:"+authorized );
				jl5.setText(address);
				jl6.setText(name);

				//open input to read data
				in = con.openInputStream();
				//out = con.openOutputStream();

				receive();

				synchronized(lock)
				{
					try {
						lock.wait();
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}



			} catch (IOException e1)
			{
				System.out.println("Connection open:"+e1);
			}

		}
		};
		t.start();
	}




	static void receive()
	{
		Thread t1= new Thread()
		{
			public void run() {
				try
				{

					boolean flag=false;
					int size;

					frameImage();

				    DataInputStream dais = new DataInputStream(in);

					while(flag=dais.readBoolean())
					{
						jl10.setText("Started");
						jl12.setText("Note: Select Stop from mobile");
						System.out.println(flag);

						//Read the length of the file
						size=dais.readInt();
						//status("\nSIZE:"+size/1024+" KB");


				        int bytesRead=0;
				        //ByteArrayOutputStream baout = new ByteArrayOutputStream();
				        byte[] jpgBytes =new byte[size];

				        long timer = System.currentTimeMillis();
				        while(size-bytesRead > 0)
				        {
				        	bytesRead += in.read(jpgBytes, bytesRead, size-bytesRead);
				        }
				        timer = System.currentTimeMillis() - timer;
				        //status("\nRecieved "+j+" : "+(double)(jpgBytes.length/1024)+" Kilobytes in "+(double)(timer/1000)+" microseconds");
				        System.out.println("\nRecieved "+j+" : "+(double)(jpgBytes.length/1024)+" Kilobytes in "+timer+" microseconds");
				        jl11.setText((float)(jpgBytes.length)/timer+"Kbps");
				       drawing(jpgBytes);


					}

					System.out.println(flag);
				}
				catch(Exception e)
				{
					System.out.println("Receive:"+e);
				}

				synchronized(lock)
				{
					lock.notify();
				}

			}
		};
		t1.start();
	}

	static void status (String mesg)
	{
		jta.append(mesg);
	}

	static void frameImage()
	{
		Thread t2 = new Thread()
		{
			public void run()
			{
				try
				{
					fr = new JFrame("Display image");
					fr.setSize(320,240);
				    fr.setVisible(true);
				    fr.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

				    /*jp=new JPanel();
				    jp.setLayout(null);
				    jp.setBounds(0,0,320,240);
				    fr.add(jp);*/
				}
				catch(Exception e)
				{
					System.out.println(e);
				}
			}
		};
		t2.start();

	}

	static void drawing(final byte[] data)
	{
		Thread t3 = new Thread()
		{
			public void run()
			{
				BufferedImage im;
				Image image = null;

				if (data != null && (data.length > 0))
				{
	                try
	                {
						im = ImageIO.read(new ByteArrayInputStream(data));
						image = Toolkit.getDefaultToolkit().createImage(im.getSource());
					}
	                catch (IOException e)
	                {
					   	e.printStackTrace();
					}
				}



				System.out.println(image.getHeight(null)+" "+image.getWidth(null));


			  //we use MediaTracker to make sure that we don't display image
				//before it gets created
				/*MediaTracker tracker = new MediaTracker(null);
				try
				{
					tracker.addImage(image, 0);
					tracker.waitForID(0);
				}
				catch(InterruptedException ie)
				{
					System.out.println("Media tracker:"+ie);
				}*/

				imgpanel=new ImagePanel();
				fr.add(imgpanel);
			    imgpanel.setImage(image);


				int w = image.getWidth(null);
		        int h = image.getHeight(null);
		        BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
		        Graphics2D g2 = bi.createGraphics();
		        g2.drawImage(image, 0, 0, null);
		        g2.dispose();
		        try
		        {
					//ImageIO.write(bi, "jpg", new File("d:/imageTest.jpg"));
		        	File f = new File("c:\\ServerBishwajeet");
		            f.mkdir();

					out=new FileOutputStream("c:/ServerBishwajeet/recived"+j+".jpg");
			        out.write(data);
			        out.flush();
			        j++;
				}
		        catch (IOException e)
		        {
					e.printStackTrace();
				}


			}
		};
		t3.start();
	}

}


class ImagePanel extends JPanel
{
    public Image myimg = null;
    public ImagePanel()
    {
      setBounds(0,0,320,240);
      //setMinimumSize(new Dimension(320, 240));
      //setMaximumSize(new Dimension(320, 240));
    }
    public void setImage(Image img)
    {
        this.myimg = img;
        repaint();
    }
   public void paint(Graphics g)
    {
      if (myimg != null)
      {
    	  g.drawImage(myimg, 0, 0, this);
      }
    }
}






                         

Was This Post Helpful? 0
  • +
  • -

#10 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12324
  • View blog
  • Posts: 45,424
  • Joined: 27-December 08

Re: project in java

Posted 18 November 2010 - 05:26 AM

This looks like the end-user app. There needs to be something on the computer side as well to take the screenshots, etc, which is where you would implement my suggestions.
Was This Post Helpful? 0
  • +
  • -

#11 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 18 November 2010 - 06:56 AM

so what commands i have to add reply
Was This Post Helpful? -3
  • +
  • -

#12 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 18 November 2010 - 11:48 PM

sir there is an error is coming in my code please resolve it
my project name is "PC control by using mobile"


please check the code


   server side code is


import java.io.*;
import javax.bluetooth.*;
import javax.microedition.io.*;
import java.awt.Robot;
import java.awt.event.InputEvent;
public class EchoServer {



private int x1=450;
private int y1=550;


int msg;

public final UUID uuid = new UUID( //the uid of the service, it has to be unique,
"27012f0c68af4fbf8dbe6bbaf7aa432a", false); //it can be generated randomly
public final String name = "Echo Server"; //the name of the service
public final String url = "btspp://localhost:" + uuid //the service url
+ ";name=" + name
+ ";authenticate=false;encrypt=false;";
LocalDevice local = null;
StreamConnectionNotifier server = null;
StreamConnection conn = null;

public EchoServer() {
try {
System.out.println("Setting device to be discoverable...");
local = LocalDevice.getLocalDevice();
local.setDiscoverable(DiscoveryAgent.GIAC);
System.out.println("Start advertising service...");
server = (StreamConnectionNotifier)Connector.open(url);
System.out.println("Waiting for incoming connection...");
conn = server.acceptAndOpen();
System.out.println("Client Connected...");
DataInputStream din = new DataInputStream(conn.openInputStream());

Robot robo=new Robot();


while(true){
// String cmd = "";
char c;
while (((c = din.readChar()) > 0) && (c!='\n') ){
// cmd = cmd + c;

/* System.out.println("Received " + cmd);
msg=Integer.parseInt(cmd);
System.out.println("Received " + cmd);*/

System.out.println("Received " + c);
// System.out.println("Rece " + msg);

if(c=='G')
{
robo.mouseMove(x1,y1);
x1=x1-10;
}
else if(c=='A')
{
robo.mouseMove(x1,y1);
y1=y1-10;
}
else if(c=='M')
{
robo.mouseMove(x1,y1);
x1=x1+10;
}
else if(c=='T')
{
robo.mouseMove(x1,y1);
y1=y1+10;
}
else if(c=='J')
{
robo.mousePress(InputEvent.BUTTON1_MASK);
robo.mousePress(InputEvent.BUTTON1_MASK);
// robo.mouseRelease(InputEvent.BUTTON1_MASK);
// robo.keyPress(KeyEvent.VK_ENTER);
// robo.keyRelease(KeyEvent.VK_ENTER);
robo.mouseRelease(InputEvent.BUTTON1_MASK);
// robo.mousePress(InputEvent.BUTTON1_MASK);
robo.mouseRelease(InputEvent.BUTTON1_MASK);


}






}


// System.out.println("Received " + cmd);
}

} catch (Exception e) {System.out.println("Exception Occured: " + e.toString());}
}

public static void main (String args[]){
EchoServer echoserver = new EchoServer();
}

}



client side code:



import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import javax.bluetooth.*;
import java.io.*;
public class EchoClient extends MIDlet
implements CommandListener,DiscoveryListener {
List main_list,dev_list;
Command exit,ok;
TextBox cmd;
Display display;
java.util.Vector devices,services;
LocalDevice local;
DiscoveryAgent agent;
DataOutputStream dout;
int currentDevice = 0;
String key1;
//used as an indicator to the device queried for
//the echo server

public void startApp() {
main_list = new List("Echo Server",Choice.IMPLICIT); //the main menu
dev_list = new List("Select Device",Choice.IMPLICIT); //the list of devices
// cmd = new TextBox("Text to echo","",120,TextField.ANY);
exit = new Command("Exit",Command.EXIT,1);
ok = new Command("Send",Command.OK,1);
display = Display.getDisplay(this);

main_list.addCommand(exit);
main_list.setCommandListener(this);
dev_list.addCommand(exit);
dev_list.setCommandListener(this);
// cmd.addCommand(ok);
// cmd.setCommandListener(this);



main_list.append("Find Echo Server",null);
display.setCurrent(main_list);


}
public void commandAction(Command com, Displayable dis) {
if (com == exit){ //exit triggered from the main form
destroyApp(false);
notifyDestroyed();
}
if (com == List.SELECT_COMMAND){
if (dis == main_list){ //select triggered from the main from
if (main_list.getSelectedIndex() >= 0){ //find devices
FindDevices();
do_alert("Searching for devices...", Alert.FOREVER);
}
}
if (dis == dev_list){ //select triggered from the device list
StreamConnection conn = null;
ServiceRecord service = (ServiceRecord)
services.elementAt(dev_list.getSelectedIndex());
String url = service.getConnectionURL(
ServiceRecord.NOAUTHENTICATE_NOENCRYPT,
false);
try {
conn = (StreamConnection) Connector.open(url); //establish the connection
dout = new DataOutputStream(conn.openOutputStream());//Get the output stream
display.setCurrent(cmd); //Show the textbox
} catch (Exception e) {this.do_alert("Error Connecting" , 4000);}

}
}
if(com == ok){ //the user is sending a command
try{

dout.writeChars(key1);
//dout.writeChars(cmd.getString() + "\n");
dout.flush();
cmd.setString("");
} catch (Exception e) {this.do_alert("Error sending data" , 4000);}
}
}

public void FindDevices(){
try{
devices = new java.util.Vector();
LocalDevice local = LocalDevice.getLocalDevice();
DiscoveryAgent agent = local.getDiscoveryAgent();
agent.startInquiry(DiscoveryAgent.GIAC,this);
}catch(Exception e){this.do_alert("Erron in initiating search" , 4000);}
}

public void FindServices(RemoteDevice device){
try{
UUID[] uuids = new UUID[1];
uuids[0] = new UUID("27012f0c68af4fbf8dbe6bbaf7aa432a",false); //The UUID of the ech service
local = LocalDevice.getLocalDevice();
agent = local.getDiscoveryAgent();
agent.searchServices(null,uuids,device,this);
}catch(Exception e){this.do_alert("Erron in initiating search" , 4000);}
}

public void deviceDiscovered(RemoteDevice remoteDevice,DeviceClass deviceClass) {
devices.addElement(remoteDevice);
}

public void servicesDiscovered(int transID,ServiceRecord[] serviceRecord) {
for (int x = 0; x < serviceRecord.length; x++ )
services.addElement(serviceRecord[x]);
try{
dev_list.append(((RemoteDevice)devices.elementAt(currentDevice)).
getFriendlyName(false),null);
}catch(Exception e){this.do_alert("Erron in initiating search" , 4000);}
}
public void inquiryCompleted(int param){
switch (param) {
case DiscoveryListener.INQUIRY_COMPLETED: //Inquiry completed normally
if (devices.size() > 0){ //Atleast one device has been found
services = new java.util.Vector();
this.FindServices((RemoteDevice)
devices.elementAt(0)); //Check if the first device offers the service
}else
do_alert("No device found in range",4000);
break;
case DiscoveryListener.INQUIRY_ERROR: // Error during inquiry
this.do_alert("Inqury error" , 4000);
break;
case DiscoveryListener.INQUIRY_TERMINATED: // Inquiry terminated by agent.cancelInquiry()
this.do_alert("Inqury Canceled" , 4000);
break;
}
}

public void serviceSearchCompleted(int transID, int respCode) {
switch(respCode) {
case DiscoveryListener.SERVICE_SEARCH_COMPLETED:
if(currentDevice == devices.size() -1){ //all devices have been searched
if(services.size() > 0){
display.setCurrent(dev_list);
}else
do_alert("The service was not found",4000);
}else{ //search next device
currentDevice++;
this.FindServices((RemoteDevice)devices.elementAt(currentDevice));
}
break;
case DiscoveryListener.SERVICE_SEARCH_DEVICE_NOT_REACHABLE:
this.do_alert("Device not Reachable" , 4000);
break;
case DiscoveryListener.SERVICE_SEARCH_ERROR:
this.do_alert("Service serch error" , 4000);
break;
case DiscoveryListener.SERVICE_SEARCH_NO_RECORDS:
this.do_alert("No records returned" , 4000);
break;
case DiscoveryListener.SERVICE_SEARCH_TERMINATED:
this.do_alert("Inqury Cancled" , 4000);
break;
}
}

public void do_alert(String msg,int time_out){
if (display.getCurrent() instanceof Alert ){
((Alert)display.getCurrent()).setString(msg);
((Alert)display.getCurrent()).setTimeout(time_out);
}else{
Alert alert = new Alert("Bluetooth");
alert.setString(msg);
alert.setTimeout(time_out);
display.setCurrent(alert);
}
}


Canvas canvas = new Canvas()
{ // anonymous class
public void paint(Graphics g) {
g.setColor(255, 255, 255);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(255, 0, 0);
g.drawString(key1, 100, 100, Graphics.TOP|Graphics.LEFT);

}
protected void keyPressed(int keyCode)
{

key1=Integer.toString(keyCode);
commandAction(ok, null);
}

/* protected void keyReleased(int keyCode)
{
if (keyCode > 0) {
System.out.println("keyReleased " + ((char) keyCode));
}
else {
System.out.println("keyReleased action " + getGameAction(keyCode));
}
}*/
};

display.setCurrent(canvas);


public void pauseApp() {}

public void destroyApp(boolean unconditional) {}

}

                   



sir please check the code some errors are coming i cant resolve it
please i try my best
Was This Post Helpful? 0
  • +
  • -

#13 masijade   User is offline

  • D.I.C Addict
  • member icon

Reputation: 196
  • View blog
  • Posts: 580
  • Joined: 03-April 10

Re: project in java

Posted 18 November 2010 - 11:53 PM

Well, it might help to know what "errors". I, for one, am not going to sit here and try to play both compiler and JVM to figure it out. Post the complete error/compiler message(s) with stacktrace(s).
Was This Post Helpful? 0
  • +
  • -

#14 pakeezah   User is offline

  • New D.I.C Head

Reputation: -6
  • View blog
  • Posts: 12
  • Joined: 17-November 10

Re: project in java

Posted 19 November 2010 - 12:11 AM

import javax.microedition.midlet.*;
\MobileApplication4\src\hello\HelloMIDlet.java:118: class or interface expected
import javax.microedition.lcdui.*;
C:\Documents and Settings\ADMIN\My Documents\JavaMESDKProjects\MobileApplication4\src\hello\HelloMIDlet.java:119: class or interface expected
import javax.microedition.io.*;
C:\Documents and Settings\ADMIN\My Documents\JavaMESDKProjects\MobileApplication4\src\hello\HelloMIDlet.java:120: class or interface expected
import javax.bluetooth.*;
C:\Documents and Settings\ADMIN\My Documents\JavaMESDKProjects\MobileApplication4\src\hello\HelloMIDlet.java:121: class or interface expected
import java.io.*;
C:\Documents and Settings\ADMIN\My Documents\JavaMESDKProjects\MobileApplication4\src\hello\HelloMIDlet.java:315: <identifier> expected
display.setCurrent(canvas);
C:\Documents and Settings\ADMIN\My Documents\JavaMESDKProjects\MobileApplication4\src\hello\HelloMIDlet.java:315: <identifier> expected
display.setCurrent(canvas);



sir in these bold lines error are coming
Was This Post Helpful? 0
  • +
  • -

#15 masijade   User is offline

  • D.I.C Addict
  • member icon

Reputation: 196
  • View blog
  • Posts: 580
  • Joined: 03-April 10

Re: project in java

Posted 19 November 2010 - 12:23 AM

Are you attempting to include both of these classes in the same java file?

P.S. Where are your package declarations? Do not create classes in the "default" (i.e. without a) package.

Also, why are you shamelessly copying the Networking tutorial classes, without even bothering to change the class names, and then calling them some "remote control" BS?

Before attempting what you seem to be attempting, learn to program.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2