Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JList item Doble click  RSS feed

Allen Bandela
Ranch Hand
Posts: 128
Eclipse IDE MS IE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What could be the possible reason why I am finding two files opened when I click an item in my JList. The code is as follows. It works well the first time . Thereafter I get this problem.

public void mouseClicked(MouseEvent evt) {

if(evt.getClickCount()==2) { //Double Click
System.out.println("MOuse clicked double");
// Get item index
int index2=list.locationToIndex(evt.getPoint());
for(int i=0;i<titleCopy.length;i++)
website=new URL(getDocumentBase(),pdffile);
this.getAppletContext().showDocument( website, "_blank" );// Requests that the browser show the Web page indicated by the URL document
}catch(Exception e)
System.out.println("Some exception has occured boy");
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!