Examples of PercentLayout


Examples of com.l2fprod.common.swing.PercentLayout

  private DefaultCellRenderer label;
  private JButton button;
  private Envelope envelope;

  public EnvelopePropertyEditor() {
    editor = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 0));
    ((JPanel) editor).add("*", label = new DefaultCellRenderer());
    label.setOpaque(false);
    ((JPanel) editor).add(button = ComponentFactory.Helper.getFactory()
        .createMiniButton());
    button.addActionListener(new ActionListener() {
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

  private ColorCellRenderer label;
  private JButton button;
  private Color color;

  public ColorPropertyEditor() {
    editor = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 0));
    ((JPanel) editor).add("*", label = new ColorCellRenderer());
    // label.setOpaque(false);
    /*   
        ((JPanel) editor).add(button = ComponentFactory.Helper.getFactory().createMiniButton());   
        button.addActionListener(new ActionListener() {
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

  private ColorCellRenderer label;
  private JButton button;
  private Color color;

  public ColorPropertyEditor() {
    editor = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 0));
    ((JPanel)editor).add("*", label = new ColorCellRenderer());
    label.setOpaque(false);
    ((JPanel)editor).add(button = ComponentFactory.Helper.getFactory()
      .createMiniButton());
    button.addActionListener(new ActionListener() {
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

    ResourceBundle bundle = ResourceBundle.getBundle(FontChooserUI.class
        .getName()
        + "RB");

    // FIRST PANEL with Font list
    fontPanel = new JPanel(new PercentLayout(PercentLayout.VERTICAL, 2));
    fontPanel.add(label = new JLabel(bundle
        .getString("FontChooserUI.fontLabel")));
    fontPanel.add(fontField = new JTextField(25));
    fontField.setEditable(false);
    fontPanel.add(new JScrollPane(fontList = new JList()), "*");
    label.setLabelFor(fontList);
    label.setDisplayedMnemonic(bundle.getString(
        "FontChooserUI.fontLabel.mnemonic").charAt(0));
    fontList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    String[] fontFamilies = chooser.getModel().getFontFamilies(null);
    fontList.setListData(fontFamilies);

    // SECOND PANEL with Bold, Italic, Charset
    JPanel fontEffectPanel = new JPanel(new PercentLayout(
        PercentLayout.VERTICAL, 2));
    fontEffectPanel.add(label = new JLabel(bundle
        .getString("FontChooserUI.styleLabel")));
    fontEffectPanel.add(fontEffectField = new JTextField(10));
    fontEffectField.setEditable(false);
    fontEffectPanel.add(new JScrollPane(fontEffectList = new JList()), "*");
    label.setLabelFor(fontEffectList);
    label.setDisplayedMnemonic(bundle.getString(
        "FontChooserUI.styleLabel.mnemonic").charAt(0));
    fontEffectList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    FontStyle[] fontStyles = new FontStyle[]{
        new FontStyle(Font.PLAIN, bundle.getString("FontChooserUI.style.plain")),
        new FontStyle(Font.BOLD, bundle.getString("FontChooserUI.style.bold")),
        new FontStyle(Font.ITALIC, bundle
            .getString("FontChooserUI.style.italic")),
        new FontStyle(Font.BOLD | Font.ITALIC, bundle
            .getString("FontChooserUI.style.bolditalic")),};
    fontEffectList.setListData(fontStyles);

    // The SIZE PANEL
    fontSizePanel = new JPanel(new PercentLayout(PercentLayout.VERTICAL, 2));
    fontSizePanel.add(label = new JLabel(bundle
        .getString("FontChooserUI.sizeLabel")));

    label.setDisplayedMnemonic(bundle.getString(
        "FontChooserUI.sizeLabel.mnemonic").charAt(0));

    fontSizePanel.add(fontSizeField = new JTextField(5));
    label.setLabelFor(fontSizeField);
    fontSizePanel.add(new JScrollPane(fontSizeList = new JList()), "*");

    int[] defaultFontSizes = chooser.getModel().getDefaultSizes();
    String[] sizes = new String[defaultFontSizes.length];
    for (int i = 0, c = sizes.length; i < c; i++) {
      sizes[i] = String.valueOf(defaultFontSizes[i]);
    }
    fontSizeList.setPrototypeCellValue("012345");
    fontSizeList.setListData(sizes);
    fontSizeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    fontSizeList.setVisibleRowCount(2);

    chooser.setLayout(LookAndFeelTweaks.createBorderLayout());
    JPanel panel = new JPanel();
    panel.setLayout(LookAndFeelTweaks.createHorizontalPercentLayout());
    panel.add(fontPanel, "*");
    panel.add(fontEffectPanel);
    panel.add(fontSizePanel);

    previewPanel = new JTextArea();
    previewPanel.setText(chooser.getModel().getPreviewMessage(null));
    JScrollPane scroll = new JScrollPane(previewPanel);

    JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    split.setBorder(null);
    split.setTopComponent(panel);
    split.setBottomComponent(scroll);
    split.setDividerLocation(0.5);
    split.setOneTouchExpandable(true);
    chooser.add("Center", split);

    // allow the split pane to completely hide the top panel
    panel.setMinimumSize(new Dimension(0, 0));
   
    JPanel charSetPanel = new JPanel(new PercentLayout(
        PercentLayout.HORIZONTAL, 2));
    label = new JLabel("CHARSET");
    label.setHorizontalAlignment(JLabel.RIGHT);
    charSetPanel.add(label, "*");

 
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

  public FilePropertyEditor() {
    this(true);
  }
 
  public FilePropertyEditor(boolean asTableEditor) {
    editor = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 0)) {
      public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        textfield.setEnabled(enabled);
        button.setEnabled(enabled);
        cancelButton.setEnabled(enabled);
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

* A simple example showing how to use the JFontChooser.
*/
public class ChooseFont extends JPanel {

  public ChooseFont() {
    setLayout(new PercentLayout(PercentLayout.VERTICAL, 3));

    JFontChooser chooser = new JFontChooser();
    chooser.setSelectedFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 56));
    add("*", chooser);

View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

    outlook.addTab("Disabled", new JButton());
    outlook.setEnabledAt(3, false);
    outlook.setAllTabsAlignment(alignment);
   
    JPanel panel = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 3));
    panel.add(outlook, "100");
    return panel;
  }
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

    return panel;
  }

  void addTab(JOutlookBar tabs, String title) {
    JPanel panel = new JPanel();
    panel.setLayout(new PercentLayout(PercentLayout.VERTICAL, 0));
    panel.setOpaque(false);

    String[] buttons = new String[] {"Inbox", "icons/outlook-inbox.gif",
      "Outbox", "icons/outlook-outbox.gif", "Drafts", "icons/outlook-inbox.gif",
      "Templates", "icons/outlook-inbox.gif", "Deleted Items",
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

  public final static ResourceManager RESOURCE = ResourceManager
    .get(ChooseDirectory.class);

  public ChooseDirectory() {
    setLayout(new PercentLayout(PercentLayout.VERTICAL, 3));

    if (System.getProperty("javawebstart.version") != null) {  
      JTextArea area = new JTextArea(RESOURCE.getString("message.webstart"));
      LookAndFeelTweaks.makeMultilineLabel(area);
      area.setFocusable(false);
View Full Code Here

Examples of com.l2fprod.common.swing.PercentLayout

  private DefaultCellRenderer label;
  private JButton button;
  private Font font;
 
  public FontPropertyEditor() {
    editor = new JPanel(new PercentLayout(PercentLayout.HORIZONTAL, 0));
    ((JPanel)editor).add("*", label = new DefaultCellRenderer());
    label.setOpaque(false);
    ((JPanel)editor).add(button = ComponentFactory.Helper.getFactory()
      .createMiniButton());
    button.addActionListener(new ActionListener() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.