swing - Show a message in a message window in Java -


i want show message window displaying string value, don't know how write it. have code:

for (bufferedimage bimage : lineimage1) {     int trafficsection[] = analysis.colorshare(screencapturing.getmaptrafficonly(), bimage);     string trafficstring = trafficsection[0] + " - " + trafficsection[1] + " - " + trafficsection[2] + " - " + trafficsection[3];      joptionpane.showmessagedialog(this, trafficstring, joptionpane.information_message); } 

but doesn't work. can me please how write code message window?

thanks

here error:

java: no suitable method found showmessagedialog(<anonymous cege.controller.screencapturecontroller.screencapturelistener>,java.lang.string,java.lang.string,int)     method javax.swing.joptionpane.showmessagedialog(java.awt.component,java.lang.object,java.lang.string,int,javax.swing.icon) not applicable       (actual , formal argument lists differ in length)     method javax.swing.joptionpane.showmessagedialog(java.awt.component,java.lang.object,java.lang.string,int) not applicable       (actual argument <anonymous cege.controller.screencapturecontroller.screencapturelistener> cannot converted java.awt.component method invocation conversion)     method javax.swing.joptionpane.showmessagedialog(java.awt.component,java.lang.object) not applicable       (actual , formal argument lists differ in length) 

i solved it. put name of class before this.

joptionpane.showmessagedialog(null, "write msg here", "title msg", joptionpane.warning_message); 

this warning message. if want other, change warning_message type (might take more or less params). http://docs.oracle.com/javase/7/docs/api/javax/swing/joptionpane.html


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -