Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners different output trying to execute same java code

Have Programming Question? Ask it here!
 
 
 


srinivasan
different output trying to execute same java code
0 Answer(s)      2 years and 2 months ago
Posted in : Java Beginners


i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding to read value from serial port :

import java.io.*;
import java.util.*;
import javax.comm.*;

public class SimpleRead implements Runnable, SerialPortEventListener {

static CommPortIdentifier portId;
 static Enumeration portList;

InputStream inputStream;
SerialPort serialPort;
Thread readThread;

public static void main(String[] args) {


portList = CommPortIdentifier.getPortIdentifiers();
JOptionPane.showMessageDialog(null, "portList :"+portList.hasMoreElements()); 
while (portList.hasMoreElements()) {
  portId = (CommPortIdentifier) portList.nextElement();
  if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
   if (portId.getName().equals("COM3")) {
         SimpleRead reader = new SimpleRead();
  }
}

} }

public SimpleRead() {
 ....

...... }

public void run() {
  try {
    Thread.sleep(20000);
  } catch (InterruptedException e) {System.out.println(e);}
}

public void serialEvent(SerialPortEvent event) {
  switch(event.getEventType()) {
    .....

...... ..... ...... } } }

When i execute from netbeans, JOptionPane showing "portList : true" but when i double click on the jar file and tried to run, JOptionPane showing "portList : false"

Why there is different output trying to execute same java code


Advertisement
View Answers

Related Tutorials/Questions & Answers:
different output trying to execute same java code
there is different output trying to execute same java code...different output trying to execute same java code  i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding
different output trying to execute same java code
different output trying to execute same java code  i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding... " portList : false" Why there is different output trying to execute same java
Advertisements
different output trying to execute same java code
different output trying to execute same java code  i am using net beans 7 ide and java 6 to develop my java projects. i used the following coding... " portList : false" Why there is different output trying to execute same java
SHOWING ERROR CODE 1064 WHILE TRYING TO EXECUTE PROCEDURE
SHOWING ERROR CODE 1064 WHILE TRYING TO EXECUTE PROCEDURE  I AM TRYING A SP BUT IT IS NOT SAVING AND WORKING.DOES THE STORED PROCEDURE WORK PARTLY... ARE WORKING PROPERLY. BUT WHEN I AM TRYING TO EXECUTE THEM INSIDE
How to ensure the same output by java code on 32 bit m/c and 64 bit m/c
How to ensure the same output by java code on 32 bit m/c and 64 bit m/c  How to ensure the same output by java code on 32 bit m/c and 64 bit m/c
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?  How to print different Messge for the same NumberFormatException on different cause objects in JAVA? try { int
Java error cannot find symbol
("value of a"+a); } } Output : When you compile and execute...Java error cannot find symbol In this section you will learn about "cannot find symbol" in java. Java cannot find symbol is a type of error occurs
login for different user in the same page
login for different user in the same page  how can i do the login for different user in the same page throug jsp
Java code for Saving Marathi (Indian local language ) in Mysql and retrieving the same
Java code for Saving Marathi (Indian local language ) in Mysql and retrieving... going to save the marathi data into mysql and trying to retrieving the same from...; And my output is : Same o/p I gets in eclipse console. Can you tell me the solution
Servlet signup same output - JSP-Servlet
Servlet signup same output  Ok i solved the problem of content type by res.setContentType("text/plain"), but the output is same it always prints....   Hi friend, Plz give full details with source code to solve
Updating rows who has same id with different values for each row from java program
Updating rows who has same id with different values for each row from java...) with "lalitha" as a value for sname column from java program. Same for records with sid... rows with same id. student table: sid sname age 2 aruna 25 2
Java Read Lines from Text File and Output in Reverse order to a Different Text File
Java Read Lines from Text File and Output in Reverse order to a Different Text... to another text file. When that is done the output values of that file need to display in a JTextArea field. I have a good share of the code done and an area
java code to validate column content of 2 different tables in 2 different databases.
java code to validate column content of 2 different tables in 2 different... at different server and display output( in excel format) using JAVA. if matched... that the migrated data is correct by creatng a script to run written in java
Execute .dll file in java?
Execute .dll file in java?  please anybody give me solution for executing .dll files in java
how to write code for this output?
how to write code for this output?   1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
how to execute this code - JSP-Servlet
how to execute this code  hi guys can any help me in executing this bank application http://www.roseindia.net/jsp/bank.shtml, i need to use any database plz tell me step-to-step procedure for executing this,i need to create
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s the problem?  I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s the problem?  I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what?s
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
Does finally always execute in Java?
Does finally always execute in Java?  Does finally always execute in Java
How can I output text typed in textarea by user on the same page?
How can I output text typed in textarea by user on the same page?  I... would like to take the comments and append them to the same page for all to see. Is this posibble and if so could you give me the code and instructions to do
error in program when trying to load image in java - Java Beginners
error in program when trying to load image in java  Hi, I'm trying to add an image to my GUI using java graphics. I have cleaned up all my compiler...) at sun.awt.image.ImageFetcher.run(Unknown Source) this is my code
Java Execute Jar file
operating system or platform. To execute a JAR file, one must have Java... file type java -jar [Jar file Name] in the command prompt. To execute...JAR stands for Java ARchive and is platform independent. By making all
What is the equivalent method in Java which is equivalent to clrscr() in c/c++ . The code should help to clear the output screen ?
What is the equivalent method in Java which is equivalent to clrscr() in c/c++ . The code should help to clear the output screen ?  Hello to all, I have searched the net to know that is there any equivalent method for clrscr
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet  package com.readfiles; import... ServletException, IOException { String pdfFileName = "Java Tips.pdf
output java - Java Beginners
; } a. what is the output of the ff. java statement:? i. System.out.println (secret...output java  public static int secret(int one) { int i; int...?  Hello Are you beginner? Ok, The first Output is 125
updating rows which contains same id, different value for each row
updating rows which contains same id, different value for each row  ... rows with sid 5. Like this table may contains multiple records with same sid. Here my requirement is "I have to update those records which contains same sid
java program of different shapes
java program of different shapes  pls help me to get the code of a java program of different shapes using menu
can i Execute PHP code inside python script?
can i Execute PHP code inside python script?    can i Execute PHP code inside python script
how to execute a unix shell script from a java program
the script name from a java code .once you execute this java program...how to execute a unix shell script from a java program  well , i am... solution . could anyone please give a sample code as of how to do this... what i am
input output in java
input output in java  java program using filereader and filewriter   Hi Friend, Try the following code: import java.io.*; class... Friend, Try the following code: import java.io.*; class
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
Execute the java program using one processor
Execute the java program using one processor   Write a program to print the number series 1, 2,3, 4ΓΆβ?¬Β¦.100 using java programming language in dual core computer a) Execute the program using one processor b) Execute
how to distinguish engines having same code - Struts
introduced a new engine for testing purpose it has almost same code as previous engine...how to distinguish engines having same code  hi we are using struts... as both access same database .file is kept in central repository both engine
output
output  Sir,I am experiencing some problems with the output of this program.I got some useful help this website,but the output of the program isn't producing what it should.let me explain the output below is what happen when
Can JavaScript code be broken in different lines?
Can JavaScript code be broken in different lines?  Can JavaScript code be broken in different lines
try to execute this code getting class cast exception, please resolve it.
try to execute this code getting class cast exception, please resolve it.  package test; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; public class Over { static int k
Input / Output in Easiest Method in Java
Input / Output in Easiest Method in Java  How to input from keyboard, both strings and characters and display the result on the screen with the easiest method in Java?   Hi Friend, Try the following code: import
different type input in java
different type input in java  hiiiii... get input different different type like as DataInputStream,Scanner i want to get source code of these all type of input method. thank   Java Read through DataInputStream: import
Multithreading in Java
Multithreading in java is running multiple threads sharing same address space... then the CPU can switch between the two threads to execute them at the same time... Multithreading allows a process to run its tasks in parallel mode and execute
Program compiles but won't execute - Java Beginners
so far for the Employee class(it compiles but does not execute); public class... written which again compiles but does not execute; public class Driver
Command Line Standard Output In Java
Command Line Standard Output In Java In this section we will discuss about the Command Line Java IO Standard Output. Standard streams, feature of various O/S, are written through standard output in Java. Standard streams can
Output of this one - Java Interview Questions
errors. The following code displays "Executed" as an output. public class...Output of this one   public class Test { int i=-277; { try{ if(Byte i<<1) { System.out.println("Executed"); } else
Advertisements
 

 

 

DMCA.com