All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.alantea.swing.ribbon.RibbonGroup Maven / Gradle / Ivy

The newest version!
package net.alantea.swing.ribbon;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.Border;

import net.alantea.utils.MultiMessages;


@SuppressWarnings("serial")
public class RibbonGroup extends JPanel
{
   private JPanel group;
   int top = 0;
   
   public RibbonGroup(RibbonTab parent, String key)
   {
      super();
      
      group = new JPanel();
      setLayout(new BorderLayout());

      Border blackline = BorderFactory.createLineBorder(Color.black);
      group.setBorder(blackline);
      group.setLayout(new FlowLayout());
      parent.add(this);
      add(group, BorderLayout.CENTER);
      
      JLabel label = new JLabel(MultiMessages.get(key), SwingConstants.CENTER);
      add(label, BorderLayout.SOUTH);
   }
   
   public Component add(Component component)
   {
      group.add(component);
      return component;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy