Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel.setBorder() not found ???  RSS feed

 
irshad ahmed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying out the sample Java code at http://java.sun.com/docs/books/tutorial/uiswing/learn/example2.html
JPanel panel = new JPanel(new GridLayout(0, 1));
panel.setBorder(BorderFactory.createEmptyBorder(....));
But it says "The method setBorder(javax.swing.border.Border) is undefined for the type java.awt.Container...
Any ideas?
Thanks so much in advance,
Sincerely,
Irshad Ahmed
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works for me, if I call:
panel.setBorder(BorderFactory.createEmptyBorder ());
Is this really the code you use?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!