in java agent if put 2 joptionpane,one after other, second 1 goes behind applications opened.
i tried
change
null
this
; this:the method showmessagedialog(component, object, string, int) in type joptionpane not applicable arguments (javaagent, string, string, int)"
- get parent component possible. didn't work
- set
setalwaysontop
permission in java.policy file,also didn't work - my class extends class need, can't extend
javax.swing.jdialog
.
the code use is:
public class javaagent extends agentbase{ private static int erros=0; private static int count=0; public int geterros(){return erros;} public int getcount(){return count;} public void notesmain() { system.out.println("\n\nstart of agente!"); try { session session = getsession(); database db = session.getcurrentdatabase(); view vw = db.getview("vwtodas"); jfilechooser fc = new jfilechooser(); //get file file chooser /* filter filereader through buffered read read line @ time */ bufferedreader bufread = null; try{ //read file //work in file } }catch(ioexception a){ joptionpane.showmessagedialog(null,"problems reading file!","problems!",joptionpane.information_message); }finally{ try{ bufread.close(); }catch(ioexception b){ joptionpane.showmessagedialog(null, "problems closing file!", "problems!", joptionpane.information_message); } } system.out.println("\n\nend of agente!"); joptionpane.showmessagedialog(frame,"documents sent: " + count + "\nerrors during import: " + erros + "\ntotal: " + (count+erros),"erro",joptionpane.error_message); } } catch(notesexception e) { e.printstacktrace(); } }
}
any idea?
you can create jframe
, set on top , pass jframe
in parent component of joptionpane
:
jframe parentframe = new jframe(); parentframe.setalwaysontop(true); joptionpane.showmessagedialog(null, "problems closing file!", "problem!", joptionpane.information_message);
alternatively, if have parent component available, should use joptionpane
's parent component
Comments
Post a Comment