I am making a Java Class that's constructor will get a JForm
from its parameter and then will add a JTable
on that form programmatically as shown in below code...
public class DEMOCLASS
{
private JTable myJTable = new JTable();
public DEMOCLASS(JFrame incomingForm)
{
incomingForm.add(myJTable);
myJTable.setSize(coloumWidth,rowHeight);
myJTable.setLocation(xpos, ypos);
myJTable.setVisible(true);
//incomingForm.setComponentZOrder(myJTable,0); // Its Bringing The Component To From But Spreading It All Over The Form From Top To Bottom And Left To Right Fully :(
}
}
Now the main problem is that where this class is called, there are many component already added by some other coding and I want to bring myJTable
component on the front that is now hiding behind them. In short, I cant control others already added component. I also heard about MyGlassPane
and JLayeredPane
but cant make them work with my concept here.
So my Main question is how to bring this myJTable
at the front of all previously added components on the incomingForm
?