Jscrollpane clearer ideas
read this and see the examples at this URL
http://java.sun.com/docs/books/tutor...ents/list.html
suppose....
int nowTopis=0; //declared and ready
int nowBaseis=0; //declared and ready
listModel = new DefaultListModel();
// add the cells values to the list
listModel.addElement("each value here");
//now put the lists cells into the list
JList spanner=new JList(listModel);
nowTopis=spanner.getFirstVisibleIndex();
nowBaseis=spanner.getLastVisibleIndex();
//note you can use a JPanel to add
//to the JScrollPane() as the viewport
//but cast to a JComponent to
//control the size and to have a reference
//for resizing e.g. use the JComponent
//reference to do sizing and to change
//the JList use the JPanel reference
//Truthfully though
//"just change the list model" not the
//JPanel contents.
//JList provides
//setVisibleRowCount(int visibleRowCount)
//assosciated also and useable for that
//you appear to be needing for coords is
//javax.swing Interface ListCellRenderer
//JComponent setMaximumSize(Dimension maximumSize)
e.g. suppose...
JPanel contentment=new JPanel();
contentment.add(spanner);
//This is the cast syntax below because
//Component and Container are abstract
//classes and cannot be instantiated by
//"new" but are not static((static)declared
//first not used instantly)
// Very imortant next line(cast to)
JComponent sqishhh=(JComponent)contentment;
sqishhh.setMaximumSize(new Dimension(200,500));
sqishhh.setMinimumSize(new Dimension(100,300));
sqishhh.setVisible(true);
JScrollPane yawn=new JScrollPane(sqishhh);
// do setting (note Viewport and Scrollable
//interface).
JComponent scrunch=(JComponent)yawn;
// and add requirements...
//enough dot operation of this struct
//i hope.
stop...