Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
12.3 Including Applets for the Java Plug In
283
Listing 12.11 LabelPanel.java 
package coreservlets;
import java.awt.*;
import javax.swing.*;
/** A small JPanel that includes a JLabel to the left
 *  of a designated component. Also puts a titled border
 *  around the panel.
 */
public class LabelPanel extends JPanel {
  public LabelPanel(String labelMessage, String title,
                    Color bgColor, Font font,
                    JComponent component) {
    setBackground(bgColor);
    setFont(font);
    setBorder(BorderFactory.createTitledBorder(title));
    JLabel label = new JLabel(labelMessage);
    label.setFont(font);
    add(label);
    component.setFont(font);
    add(component);
  }
}
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved