 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to use Soft Bevel Border in Swing
Here, we are creating soft beven border on JComboBox:
JComboBox comboBox = new JComboBox(list);
Now, set bevel border:
comboBox.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
The following is an example to use soft bevel border in Swing:
Example
import java.awt.Font; import java.awt.GridBagLayout; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.BevelBorder; import javax.swing.border.SoftBevelBorder; public class SwingDemo {    static final String list[] = { "One", "Two", "Three", "Four", "Five", "Six" };    public static void main(String[] args) {       JFrame window = new JFrame("ComboBox Example");       JPanel panel = new JPanel();       panel.setLayout(new GridBagLayout());       JComboBox comboBox = new JComboBox(list);       comboBox.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));       panel.add(comboBox);       window.add(panel);       window.setSize(600, 400);       window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);       window.setVisible(true);    } }  Output

Advertisements
 