For Programmers: Free Programming Magazines  


Home > Archive > Java Help > January 2006 > JList doesnot show Scrollbars









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JList doesnot show Scrollbars
Nandu

2006-01-27, 3:59 am

hi gurus

I have a JList and i am adding JList to JScrollPane. But there are no
scroll bars for JList when i display the Jlist in the JFrame. I am able
access all the Jlist items moving arrow keys but i am not able to see
them. I dont know why srcoll bars are not being added to JList.

Vector tables_database = new Vector();
public JList tableList = new JList(tables_database);
public JScrollPane tableListScroll = new JScrollPane(tableList);

GridBagConstraints gbc = new GridBagConstraints();
setLayout(new GridBagLayout());
gbc = new GridBagConstraints();
tableList.setPreferredSize(new java.awt.Dimension(250, 100));
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 3;
gbc.ipadx = 350;
gbc.ipady = 125;
gbc.anchor = gbc.NORTHWEST;
gbc.insets = new java.awt.Insets(0, 100, 0, 90 );
//tableListScroll.getViewport().add(tableList);
add(tableListScroll, gbc);
tableList.addListSelectionListener(new ListSelectionListener()
{
public void valueChanged(ListSelectionEvent lsEvent)
{
tableListValueChanged(lsEvent);
}
});

please help me with your suggestions

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com