Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPopupmenu  RSS feed

 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I have the folowing program in which i want to call
Jpopmenu the name of the calss is
Jpop()
this class extends from JPanel class
and having the code about the JPop menu
and I call this class in other class IFrame2()
The Iframe2 class extends from internal class
the Iframe2 class contain the Jtabel class
when Iframe2 class called in Jframe class
the table is not apeared only Jpop class Apeared the
in JFrame class i thing it is over writen on the JTabel
i want that table apeared and when i right click on the table
the Popup shoul apeared how i do that please give me positive
suggestion
the code of Iframe2 is given below


tb=new JTabel(12,12);
JScrollPane jsp=new JScrollPane(tb);

getcontenPane().add(jsp,BorderLayout.CENTER);
getcontenPane().add(new Jpopup());
setBounds(10,10,500,500);
setVisible(true);
}

When icall this class the table could not apeared only Jpopup() class apeared
what is hapening i donot know
Thanks in Advance
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default location for a component in a BorderLayout is CENTER, so when you do

getcontenPane().add(new Jpopup());

you are putting Jpopup into the CENTER, which will replace the scroll bar.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!