//======== readThread = new Thread(this); readThread.start(); //========
} public void run() { try { Thread.sleep(100); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { Integer x = new Integer(0); switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break;
break; } y=x; System.out.println(y); } public Integer getWeight() { return y; } } ========================================================================= In my other class, I have my desktop application which called the getWeight() function from this ComControl class when i click the Jbutton2:
public DesktopApplication1View(SingleFrameApplication app) { super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc ResourceMap resourceMap = getResourceMap(); int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout"); messageTimer = new Timer(messageTimeout, new ActionListener() { public void actionPerformed(ActionEvent e) { statusMessageLabel.setText(""); } }); messageTimer.setRepeats(false); int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate"); for (int i = 0; i < busyIcons.length; i++) { busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]"); } busyIconTimer = new Timer(busyAnimationRate, new ActionListener() { public void actionPerformed(ActionEvent e) { busyIconIndex = (busyIconIndex + 1) % busyIcons.length; statusAnimationLabel.setIcon(busyIcons[busyIconIndex]); } }); idleIcon = resourceMap.getIcon("StatusBar.idleIcon"); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext()); taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { String propertyName = evt.getPropertyName(); if ("started".equals(propertyName)) { if (!busyIconTimer.isRunning()) { statusAnimationLabel.setIcon(busyIcons[0]); busyIconIndex = 0; busyIconTimer.start(); } progressBar.setVisible(true); progressBar.setIndeterminate(true); } else if ("done".equals(propertyName)) { busyIconTimer.stop(); statusAnimationLabel.setIcon(idleIcon); progressBar.setVisible(false); progressBar.setValue(0); } else if ("message".equals(propertyName)) { String text = (String)(evt.getNewValue()); statusMessageLabel.setText((text == null) ? "" : text); messageTimer.restart(); } else if ("progress".equals(propertyName)) { int value = (Integer)(evt.getNewValue()); progressBar.setVisible(true); progressBar.setIndeterminate(false); progressBar.setValue(value); } } }); }
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() {
mainPanel = new javax.swing.JPanel(); btnCapture = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jComboBox1 = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); statusPanel = new javax.swing.JPanel(); javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator(); statusMessageLabel = new javax.swing.JLabel(); statusAnimationLabel = new javax.swing.JLabel(); progressBar = new javax.swing.JProgressBar();
private final Timer messageTimer; private final Timer busyIconTimer; private final Icon idleIcon; private final Icon[] busyIcons = new Icon[15]; private int busyIconIndex = 0;
private JDialog aboutBox; } ====================================================================== This system always printout null pointer exception. Is there anything wrong with the program? It don't have any compilation error using netbean 6.9
View Answers
Related Pages:
Unable to get data from class - Development process Unable to getdatafrom class I get this code from the internet which read from comm port of the computer & modify is as below:-
package COM... the getWeight() function from this ComControl class when i click the Jbutton2
unable to get datas from oracle database unable to get datas from oracle database Dear Sir,
I am again struck in my project..
i want to display datafrom oracle database but i get...
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred
unable to retrive the data from mysql using servlet using jdbc driver unable to retrive the datafrom mysql using servlet using jdbc driver ... html page on verification.
public class LoginServlet extends HttpServlet implements..., HttpServletResponse response)
throws ServletException,IOException
{
// Get
Unable to understand Struts - Struts Unable to understand Struts I am studying in GNIIT from NIIT.
Here... but in that application when I enter the details of book, data base becomes updated but I did'nt get successfull msg.
it doesnat forwads on the success page
java script unable to connect to oracle database and insert data
is to insert datafrom jsp to oracle database 8, so i create a table in oracle... to run the jsp file from tomcat i get this error.. let me know what i am doing...
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred
Struts2...problem in JSP..unable to get the values for menuTitle!!!
Struts2...problem in JSP..unable to get the values for menuTitle!!! **Hello everyone...
i'm trying to make a dynamic menu from database in struts2... Jsp is displaying the menuId from database but not the menuTitle...where as its
unable to connect database in java
button.
4)Then give Data Source Name and click ok button.
5)Your DSN will get...unable to connect database in java Hello Everyone! i was trying to connect database with my application by using java but i am unable to connect
unable to insert data into database unable to insert data into database hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to insert data into database unable to insert data into database hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to insert data into database unable to insert data into database hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to insert data into database unable to insert data into database hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
Unable to compile class for JSP - WebSevices Unable to compile class for JSP org.apache.jasper.JasperException: Unable to compile class for JSP
When I am trying to access a java file kept under src folder under a package from a jsp page placed under web directory, I am
Unable to bind to a hashmap from jsp using spring tags - Spring Unable to bind to a hashmap from jsp using spring tags Hi,
I am unable to bind a hashmap from my jsp page.
Here is what i want to do:
I have... text box where user need to enter data. (It is to be noted that the size
How to get data datagrid ?
How to getdata datagrid ? How to getdata datagrid in jsp from...;
<td bgcolor="#888888" width="120" align="center" class="typeA"><... bgcolor="#888888" width="110" align="center" class="typeAL"><font color
unable to compile class file - JSP-Servlet unable to compile class file I wrote database connection in jsp file...*;
import java.util.ArrayList;
public class ComboboxList extends HttpServlet... * from Combolist");
List ulist = new ArrayList();
List clist = new ArrayList
Get date data type from table GET DATE DATA TYPE FROM TABLE
In this example , we will get "Date" data type from a table of "Mysql"
database and it also display...*;
import java.io.*;
import java.util.Date;
public class fetchdate {
public
How Can I get ArrayList of Data from jsp with ajax request
How Can I get ArrayList of Datafrom jsp with ajax request Hi,
I retereved 5 Employee Record of Datafrom Struts Action class to jsp with ajax... to struts action class.
Plese tell me how to send this 5 employee record table
Unable to call .jrxml file from jsp Unable to call .jrxml file from jsp Hi,
I am doing web application... then it unable to access it.Error also not showing. I will show my code and its output...())
{
rsOfIncident =db1.getExecute("Select * from Incident
Get Data From the XML File GetDataFrom the XML File
Here you will learn to
retrieve datafrom XML file using SAX parser. We use the JAXP
APIs to retrieve datafrom XML document .
Description
unable to connect to server - JSP-Servlet unable to connect to server thank you for the program code for inserting and reteriving the image but i am unable to deploy these two programs...-application-server/tomcat/install-configure.shtml
Here you will get step by step
how to get session object in simple java class??
how to get session object in simple java class?? i am fallowing... work.
1) GroupDetails.jsp
2) GroupPojo.java (simple pojo class which have setters and getters)
3) GroupServlet.java (a servlet class for control)
4
sql query to get data from two tables
sql query to getdatafrom two tables how can i get the datafrom two different tables?
Hi Friend,
Please visit the following link:
JOIN Query
Simple Query
Thanks
how to get data from checkboxes - JSP-Servlet
how to getdatafrom checkboxes hi,
i got list of tables on screen... need to get only those tables to the next page where i can get list of columns to that selected tables.
please help me. hi,
we can get the selected
how to get data from sap - WebSevices
how to getdatafrom sap Hi all,
I am new to java family.
I... third party system.
how to fetch the datafrom sap and other third party system at atime?
can we schdule the new system that collects the datafrom other
How to get data from Excel sheet - Struts
How to getdatafrom Excel sheet Hi,
I have an excel sheet with some data(including characters and numbers). Now i want read the datafrom excel sheet and display in console first then later insert this data into database
get the value from another class - Java Beginners get the value from another class Hello to all, I have stupid question.
I have main.java and ConfigXML.java(read my config xml file).
Code from...().trim();
[/code]
How I can get String alsl = ((Node)flnameTEXT.item(0
how to get data from database into dropdownlist in jsp
how to getdatafrom database into dropdownlist in jsp //Customer Name:
<select name="name">
<%
try{
Class.forName...="select * from staff";
ResultSet rs=st.executeQuery(sql);
while(rs.next
how to get data from database into dropdownlist in jsp
how to getdatafrom database into dropdownlist in jsp Customer Name:<select name="name">
<%
try{
Class.forName...=con.createStatement();
String sql="select * from staff";
ResultSet rs
how to get data from database into dropdownlist in jsp
how to getdatafrom database into dropdownlist in jsp Can anybody tell me what is the problem in this code as i am not able to fetch the datafrom... tutorial go through the link JSP GetData Into Dropdown list From Database
 
get data between date from msaccess database getdata between date from msaccess database here is my code,
i want to getdata between date using jsp with msaccess.i stored date... also.suppose
i want to getdata fromdate ("01-09-2012") to ("04-09-2012), i got output
Get JTextField value from another class Get JTextField value from another class
 ... value from other
class. For this, we have created two classes ClassA.java and ClassB.java. In
ClassA, we have defined a textbox 'text1' that will get the value from
JSP Get Data From Database
JSP GetDataFrom Database
In this section we will discuss about how to getdatafrom database using
JSP.
To getdatafrom database to a JSP page we... and put it into a result set. Then get all the datafrom the result set.
Directory
Class Class, Object and Methods
Class : Whatever we can see in this world all
the things... is termed as
a class. All the
objects are direct interacted with its class
get info from mysql using jsp and servlet get info from mysql using jsp and servlet HELLO! I wanna create a jsp page which able to let me get its name, phone and other info by asking... is an application that ask the user to enter email-id. According to that data will get
Unable to run the jsp page - JSP-Servlet Unable to run the jsp page Expert:Naga
Hi,
I need solution... details should be stored in ?orders? table in the ?shopping ? data base with the date because when the admin want to display the details from particular date
how to write to java program to get the particular data from the website
how to write to java program to get the particular datafrom the website i have to get the particular data by selecting the just numbers.. from the site .. how to get the ful details from the website by clicking the number
Need to get the Data based on Date
Need to get the Data based on Date Hie ,
I am having a criteria where i need to get the data based on date . I have written the query as "from... and has values as 2011-01-10 11:14:36.000000 . But i am getting the date from my
how to get only checked data
how to get only checked data my problem is that i have a jsp page on which i retrieve datafrom the database through servlet , on the jsp page... button it should redirect only checked data to other jsp page which is connected
How To Fetch Data From Database Into JTextArea
How To Fetch DataFrom Database Into JTextArea
In this section we will read about how to get the datafrom database table
into JTextArea... have defined for fetching the datafrom database and set
the database table value
How to get data from DB in to Text box by using Jsp & Ajax
How to getdatafrom DB in to Text box by using Jsp & Ajax I want to get the datafrom database in to text box in a jsp page by using Ajax. If I... with a and from that i need to select the required value and i should store
how to get data from list to map with out using a loop?
how to getdatafrom list to map with out using a loop? List list...("15");
how to get this data into map with out using a loop.
i want this data like this--map.put(name,id);
Is it possible to do without using loop
how to display the selected row from the data table in model panel ??
how to display the selected row from the data table in model panel ?? ... class TableRecordBean {
private ArrayList <TableData> dataList;
private...();
return dataList;
}
please help me out !~!!!!!
i get the model panel but the values
how to pass a string from one class to another
how to pass a string from one class to another hi all, Good morning. I am trying to develop a coding pass a string from one class and declare in other class. the string which i need to pass is the datafrom an file and i want
Select data from diplicated data
Select datafrom diplicated data hello i have table
location... 5:00
i need to get msce 23:00 how go get like this?
the code is
if(isset($_GET["id"]))
{
$id= $_GET["id
Data from multiple ResultSets? Datafrom multiple ResultSets? hello,
How can I getdatafrom multiple ResultSets?
Hi,
You can iterate the ResultSet separately and get the required data.
Thanks