Andy_Hollywood
May 2nd, 2003, 10:23 AM
Right
I'm not having much luck with this thing I'm trying to build:
I need to build a Screen where the Column and Row Headers do not move merely scroll along with the COntents of the main area.
Now i have this kind of set up:
public class Matrix extends JScrollPane{
public Matrix(InterestMatrix im, ArrayList customers, ArrayList products) {
this.setViewportView(new CentralMatrix(im, customers, products));
this.setColumnHeaderView(new HeaderMatrix(customers, HeaderMatrix.MATRIX_HORIZONTAL, HeaderResult.TYPE_CUSTOMER));
this.setRowHeaderView(new HeaderMatrix(products, HeaderMatrix.MATRIX_VERTICAL, HeaderResult.TYPE_PRODUCT));
this.repaint();
}
}
Each of the HEader MAtrix and Central Matrix return JPanel's
NOw i thought this would work, but it dosen't...
IS it becuase the object i am addign to the Viewport do not have Layout Managers? i had to set these to NULL so i could add my components easily to set locatiosn etc....
IS this making sense?!
Just wondering if the Layouts Managers would give me the problem, or wheteher i am missing something fundamental in my approach.
Cheers for any advice, or links to JScrollPane, ViewPort Tutorial etc...
Andy
I'm not having much luck with this thing I'm trying to build:
I need to build a Screen where the Column and Row Headers do not move merely scroll along with the COntents of the main area.
Now i have this kind of set up:
public class Matrix extends JScrollPane{
public Matrix(InterestMatrix im, ArrayList customers, ArrayList products) {
this.setViewportView(new CentralMatrix(im, customers, products));
this.setColumnHeaderView(new HeaderMatrix(customers, HeaderMatrix.MATRIX_HORIZONTAL, HeaderResult.TYPE_CUSTOMER));
this.setRowHeaderView(new HeaderMatrix(products, HeaderMatrix.MATRIX_VERTICAL, HeaderResult.TYPE_PRODUCT));
this.repaint();
}
}
Each of the HEader MAtrix and Central Matrix return JPanel's
NOw i thought this would work, but it dosen't...
IS it becuase the object i am addign to the Viewport do not have Layout Managers? i had to set these to NULL so i could add my components easily to set locatiosn etc....
IS this making sense?!
Just wondering if the Layouts Managers would give me the problem, or wheteher i am missing something fundamental in my approach.
Cheers for any advice, or links to JScrollPane, ViewPort Tutorial etc...
Andy