arm - How to solve error " Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException:"? -
i made myapp arm processor(armv7, 512 ram, debian wheezy os, openjdk-7 installed). when run myapp on os gives error. code , error below. search according error can't solve error. myapp works fine on pc have installed windows 7 , ubuntu 12.04. 1 have idea or solution suggest me?
import javax.swing.jframe; import javax.swing.jpanel; /** * * @author jay_2 */ public class myapp extends jpanel { /** * @param args command line arguments */ public static javax.swing.jtextfield inputext; private javax.swing.jlabel inputlbl; private javax.swing.jscrollpane jscrollpane1; private javax.swing.jscrollpane jscrollpane2; private javax.swing.jlabel outputlbl; public static javax.swing.jtextarea outputtextarea; private javax.swing.jlabel templbl; public static javax.swing.jlabel tempshowlbl; public static javax.swing.jtextarea temptextarea; public myapp() { // todo code application logic here setcomponents(); } private void setcomponents() { templbl = new javax.swing.jlabel("temperature :"); tempshowlbl = new javax.swing.jlabel("label"); inputlbl = new javax.swing.jlabel("input :"); inputext = new javax.swing.jtextfield(); outputlbl = new javax.swing.jlabel("output :"); jscrollpane1 = new javax.swing.jscrollpane(); outputtextarea = new javax.swing.jtextarea(); jscrollpane2 = new javax.swing.jscrollpane(); temptextarea = new javax.swing.jtextarea(55000, 10); this.setbackground(new java.awt.color(204, 255, 255)); templbl.setfont(new java.awt.font("tahoma", 1, 18)); // noi18n tempshowlbl.setfont(new java.awt.font("tahoma", 1, 14)); // noi18n inputlbl.setfont(new java.awt.font("tahoma", 1, 14)); // noi18n inputext.setfont(new java.awt.font("tahoma", 0, 14)); // noi18n inputext.settext(""); // noi18n outputlbl.setfont(new java.awt.font("tahoma", 1, 14)); // noi18n outputtextarea.setcolumns(20); outputtextarea.setrows(5); jscrollpane1.setviewportview(outputtextarea); temptextarea.setcolumns(20); temptextarea.setrows(10); jscrollpane2.setviewportview(temptextarea); javax.swing.grouplayout jpanel1layout = new javax.swing.grouplayout(this); this.setlayout(jpanel1layout); jpanel1layout.sethorizontalgroup( jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.leading).addgroup(jpanel1layout.createsequentialgroup().addcontainergap().addgroup(jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.leading).addgroup(jpanel1layout.createsequentialgroup().addcomponent(inputlbl).addcontainergap(482, short.max_value)).addgroup(javax.swing.grouplayout.alignment.trailing, jpanel1layout.createsequentialgroup().addgroup(jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.trailing).addgroup(javax.swing.grouplayout.alignment.leading, jpanel1layout.createsequentialgroup().addgroup(jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.leading).addcomponent(outputlbl).addcomponent(jscrollpane1, javax.swing.grouplayout.preferred_size, 253, javax.swing.grouplayout.preferred_size)).addpreferredgap(javax.swing.layoutstyle.componentplacement.related, 102, short.max_value).addcomponent(jscrollpane2, javax.swing.grouplayout.preferred_size, 140, javax.swing.grouplayout.preferred_size)).addgroup(jpanel1layout.createsequentialgroup().addcomponent(inputext, javax.swing.grouplayout.preferred_size, 156, javax.swing.grouplayout.preferred_size).addpreferredgap(javax.swing.layoutstyle.componentplacement.related, 122, short.max_value).addcomponent(templbl).addpreferredgap(javax.swing.layoutstyle.componentplacement.unrelated).addcomponent(tempshowlbl, javax.swing.grouplayout.preferred_size, 77, javax.swing.grouplayout.preferred_size))).addgap(36, 36, 36))))); jpanel1layout.setverticalgroup( jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.leading).addgroup(jpanel1layout.createsequentialgroup().addcontainergap().addcomponent(inputlbl).addpreferredgap(javax.swing.layoutstyle.componentplacement.related).addgroup(jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.baseline).addcomponent(inputext, javax.swing.grouplayout.preferred_size, 30, javax.swing.grouplayout.preferred_size).addcomponent(templbl, javax.swing.grouplayout.preferred_size, 23, javax.swing.grouplayout.preferred_size).addcomponent(tempshowlbl, javax.swing.grouplayout.preferred_size, 19, javax.swing.grouplayout.preferred_size)).addgroup(jpanel1layout.createparallelgroup(javax.swing.grouplayout.alignment.leading).addgroup(jpanel1layout.createsequentialgroup().addgap(43, 43, 43).addcomponent(outputlbl).addpreferredgap(javax.swing.layoutstyle.componentplacement.unrelated).addcomponent(jscrollpane1, javax.swing.grouplayout.default_size, 154, short.max_value)).addgroup(jpanel1layout.createsequentialgroup().addgap(3, 3, 3).addcomponent(jscrollpane2, javax.swing.grouplayout.default_size, 222, short.max_value))).addcontainergap())); } public static void main(string[] args) { // todo code application logic here jframe jframe = new jframe(); jframe.add(new myapp()); jframe.setsize(500, 400); jframe.setdefaultcloseoperation(jframe.exit_on_close); jframe.setvisible(true); } }
error :
exception in thread "awt-eventqueue-0" java.lang.nullpointerexception: @ java.util.concurrent.locks.abstractqueuedsynchronizer.compareandsetstate(abstractqueuedsynchronizer.java:566) @ java.util.concurrent.locks.reentrantlock$nonfairsync.lock(reentrantlock.java:211) @ java.util.concurrent.locks.reentrantlock.lock(reentrantlock.java:290) @ sun.awt.suntoolkit.flushpendingevents(suntoolkit.java:551) @ java.awt.eventqueue.postevent(eventqueue.java:240) @ sun.awt.posteventqueue.flush(suntoolkit.java:2024) @ sun.awt.suntoolkit.flushpendingevents(suntoolkit.java:560) @ java.awt.eventqueue.getnextevent(eventqueue.java:523) @ java.awt.eventdispatchthread.pumponeeventforfilters(eventdispatchthread.java:180) @ java.awt.eventdispatchthread.pumpeventsforfilter(eventdispatchthread.java:128) @ java.awt.eventdispatchthread.pumpeventsforhierarchy(eventdispatchthread.java:117) @ java.awt.eventdispatchthread.pumpevents(eventdispatchthread.java:113) @ java.awt.eventdispatchthread.pumpevents(eventdispatchthread.java:105) @ java.awt.eventdispatchthread.run(eventdispatchthread.java:90) exception in thread "awt-xawt" java.lang.nullpointerexception: @ java.util.concurrent.locks.abstractqueuedsynchronizer.compareandsetstate(abstractqueuedsynchronizer.java:566) @ java.util.concurrent.locks.reentrantlock$nonfairsync.lock(reentrantlock.java:211) @ java.util.concurrent.locks.reentrantlock.lock(reentrantlock.java:290) @ sun.awt.suntoolkit.awtlock(suntoolkit.java:237) @ sun.awt.x11.xbasewindow.ungrabinput(xbasewindow.java:883) @ sun.awt.x11.xtoolkit.run(xtoolkit.java:675) @ sun.awt.x11.xtoolkit.run(xtoolkit.java:591) @ java.lang.thread.run(thread.java:722)
removed openjdk-7 version , install oracle jdk arm processor , hard float os image. here link that.oracle jdk arm processor
Comments
Post a Comment