Probably, You need to write a custom renederer for the JList. This renederer will
overwrite its paintComponent() method and will
draw a line at the bottom.
This part of the code might help
public class MyListCellRenderer extends JLabel implements ListCellRenderer
{
public Component getListCellRendererComponent(JList list, Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
setText((String) value);
return this;
}
public void paintComponent(Graphics g)
{
g.setColor(Color.black);
g.drawLine(0, getHeight()-1, getWidth()-1, getHeight()-1 );
}
}
InYourcode
list.setRenderer(new MyListCellRenedrer())
Hope it helps
- Bharat
----- Original Message -----
From: "Jose Antonio Lamas" <[EMAIL PROTECTED]>
To: "Advanced-Swing" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 3:09 PM
Subject: Drawing lines between rows in JList
> Hi,
>
> I have a JList and no lines are painted between rows. How can I paint them?
> Is there any method like showGrid? I'm using JDK 1.2.2.
>
> Perhaps in the JList these lines are not shown. Has anyone a JList with
> painted rows?
>
> Thanks
>
> _______________________________________________
> Advanced-swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/advanced-swing
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing