javax.swing.JTabbedPane.setUI()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中javax.swing.JTabbedPane.setUI()方法的一些代码示例,展示了JTabbedPane.setUI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.setUI()方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:setUI

JTabbedPane.setUI介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

jp.setLayout(new BorderLayout());
JTabbedPane tb = new JTabbedPane();
tb.setUI(new CustomTabbedPaneUI());
tb.add("Tab1", new JTextArea(""));
tb.add("Tab2", new JTextArea(""));

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * Sets the UI object which implements the L&F for this component.
 *
 * @param ui the new UI object
 * @see UIDefaults#getUI
 */
@Override
public void setUI(TabbedPaneUI ui) {
  super.setUI(ui);
}

代码示例来源:origin: com.synaptix/SynaptixSwing

public void setUI(SyTabbedPaneUI ui) {
  super.setUI(ui);
}

代码示例来源:origin: stackoverflow.com

JTabbedPane tabbedPane = new JTabbedPane(...);
tabbedPane.setUI( new MyCustomTabbedPaneUI() );

代码示例来源:origin: stackoverflow.com

JTabbedPane fooPane = new JTabbedPane();
fooPane.setUI(MetalTabbedPaneUI.createUI(fooPane));

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) throws Exception {

  JTabbedPane tabs = new JTabbedPane(JTabbedPane.LEFT);
  tabs.setUI(new BasicTabbedPaneUI() {
    @Override
    protected int calculateTabWidth(
        int tabPlacement, int tabIndex, FontMetrics metrics) {
      return 200; // the width of the tab
    }
  });

  tabs.add("Tab 1", new JButton());
  tabs.add("Tab 2", new JButton());

  JFrame frame = new JFrame("Test");
  frame.add(tabs);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setSize(400, 300);
  frame.setVisible(true);
}

代码示例来源:origin: mucommander/mucommander

public static void customizeTabbedPaneUI(JTabbedPane tabbedPane) {
  TabbedPaneUI tabbedPaneUI = tabbedPane.getUI();
  
  if (tabbedPaneUI instanceof AquaTabbedPaneUI)
    tabbedPane.setUI(new CompactAquaTabbedPaneUI());
  else if (tabbedPaneUI instanceof AquaTabbedPaneContrastUI)
    tabbedPane.setUI(new CompactAquaTabbedPaneContrastUI());
}

代码示例来源:origin: protegeproject/protege

public TabbedWorkspace() {
  tabbedPane.setUI(new CloseableTabbedPaneUI(CloseableTabbedPaneUI.TabClosability.CLOSABLE, new WorkspaceTabCloseHandler()));
  JPanel tabHolder = new JPanel(new BorderLayout());
  tabHolder.add(tabbedPane);
  setContent(tabbedPane);
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

@Override
public void setUI(TabbedPaneUI ui) {
  // Keep using tabbed pane ui so laf stays the same, but need to
  // set a new one to pick up new tabbed pane colors, fonts, etc.
  if (!DarculaUtil.isDarculaUI(ui)) {
    ui = new DockedWindowTabbedPaneUI();
  }
  super.setUI(ui);
}

代码示例来源:origin: stackoverflow.com

vFrame.setSize(200, 200);
JTabbedPane vTab = new JTabbedPane();
    vTab.setUI(new AizCustomGUI() );

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

@Override
public void configurarCores()
{
  rotuloCarregando.setBackground(ColorController.COR_PRINCIPAL);
  painelCarregamento.setBackground(ColorController.COR_PRINCIPAL);
  setBackground(ColorController.FUNDO_CLARO);
  painelAlinhamento.setBackground(ColorController.COR_PRINCIPAL);
  painelTabulado.setUI(new PSOutTabbedPaneUI());
  painelTabulado.setForeground(ColorController.COR_LETRA);
  painelAlinhamento.setForeground(ColorController.COR_LETRA);
  painelBotoes.setForeground(ColorController.COR_LETRA);
}

代码示例来源:origin: stackoverflow.com

tabs.setUI(new BasicTabbedPaneUI());

代码示例来源:origin: stackoverflow.com

import javax.swing.*; 
import java.awt.*; 
import java.awt.event.*; 
class Testing { 
public void buildGUI() { 
JTabbedPane tp = new JTabbedPane(); 
tp.addTab("A",getPanel("A")); 
tp.addTab("B",getPanel("B")); 
tp.addTab("C",getPanel("C")); 
tp.setUI(new javax.swing.plaf.metal.MetalTabbedPaneUI(){ 
protected void paintTabArea(Graphics g,int tabPlacement,int selectedIndex){} }); 
JFrame f = new JFrame(); 
f.getContentPane().add(tp); 
f.pack(); 
f.setLocationRelativeTo(null); 
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
f.setVisible(true);
 } 
public JPanel getPanel(String tabText)
 { 
JPanel p = ...

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JTabbedPane getMSTabedPane(boolean paintColorSet) {
  JTabbedPane tabs = new JTabbedPane() {
    public Color getForegroundAt(int index) {
      if (getSelectedIndex() == index) {
        return Color.BLACK;
      }
      return new Color(40, 40, 40);
    }
  };
  MSTabbedPaneUI ui;
  tabs.setUI(ui = new MSTabbedPaneUI());
  ui.setPaintColorSet(paintColorSet);
  tabs.setFocusable(false);
  return tabs;
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

@Override
public void configurarCores() {
  setBackground(ColorController.FUNDO_CLARO);
  painelTabulado.setUI(new PSOutTabbedPaneUI());
  painelTabulado.setForeground(ColorController.COR_LETRA);
  jLAutores.setForeground(ColorController.COR_LETRA);
  jLDescricao.setForeground(ColorController.COR_LETRA);
  jLIcone.setForeground(ColorController.COR_LETRA);
  jLJar.setForeground(ColorController.COR_LETRA);
  jLNome.setForeground(ColorController.COR_LETRA);
  jLVersao.setForeground(ColorController.COR_LETRA);
  jTADescricao.setForeground(ColorController.COR_LETRA);
  jTALicenca.setForeground(ColorController.COR_LETRA);
  jPInformacoes.setForeground(ColorController.COR_LETRA);        
  jListAutores.setForeground(ColorController.COR_LETRA);
  painelConteudo.setBackground(ColorController.COR_PRINCIPAL);
  jPInformacoes.setBackground(ColorController.COR_PRINCIPAL);       
  jTADescricao.setBackground(ColorController.COR_PRINCIPAL);       
  jTALicenca.setBackground(ColorController.COR_PRINCIPAL);
  jListAutores.setBackground(ColorController.COR_PRINCIPAL);
  if(WeblafUtils.weblafEstaInstalado())
  {
    WeblafUtils.configuraWebLaf(jSPAutores);
    WeblafUtils.configuraWebLaf(jSPDescricao);
    WeblafUtils.configuraWebLaf(jSPLicenca);
  }
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/** Creates new form. */
  public PaletteColorChooserMainPanel() {
    initComponents();
    setOpaque(false);
    tabbedPane.setTabLayoutPolicy(JTabbedPane.WRAP_TAB_LAYOUT);

    tabbedPane.setUI((TabbedPaneUI) PaletteTabbedPaneUI.createUI(tabbedPane));
tabbedPane.putClientProperty("Palette.TabbedPane.paintContentBorder", false);
  }

代码示例来源:origin: senbox-org/snap-desktop

private void buildUI() {
  setLayout(new GridBagLayout());
  GridBagConstraints gbc = new GridBagConstraints();
  gbc.fill = GridBagConstraints.HORIZONTAL;
  gbc.anchor = GridBagConstraints.NORTHWEST;
  gbc.insets = new Insets(DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
  gbc.weighty = 0.01;
  addTab("Windows Bundle", createTab(OSFamily.windows));
  addTab("Linux Bundle", createTab(OSFamily.linux));
  addTab("MacOSX Bundle", createTab(OSFamily.macosx));
  GridBagUtils.addToPanel(this, this.bundleTabPane, gbc, "gridx=0, gridy=0, gridwidth=11, weightx=1");
  GridBagUtils.addToPanel(this, new JLabel("Reflect in Variable:"), gbc, "gridx=0, gridy=1, gridwidth=1, weightx=0");
  variablesCombo = getEditorComponent(OSFamily.all, "updateVariable", this.variables.stream().map(SystemVariable::getKey).toArray());
  GridBagUtils.addToPanel(this, variablesCombo, gbc, "gridx=1, gridy=1, gridwidth=10, weightx=0");
  GridBagUtils.addToPanel(this, new JLabel(" "), gbc, "gridx=0, gridy=2, gridwidth=11, weighty=1");
  int selected = 0;
  switch (Bundle.getCurrentOS()) {
    case windows:
      selected = 0;
      break;
    case linux:
      selected = 1;
      break;
    case macosx:
      selected = 2;
      break;
  }
  this.bundleTabPane.setSelectedIndex(selected);
  this.bundleTabPane.setUI(new BasicTabbedPaneUI());
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void setUI(TabbedPaneUI ui) {
  super.setUI(ui);
  setFocusable(false);
  setInheritsPopupMenu(false);
  removeMouseListener(mouseInputAdapter);
  removeMouseMotionListener(mouseInputAdapter);
  addMouseListener(mouseInputAdapter);
  addMouseMotionListener(mouseInputAdapter);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

tabs.setUI(new MSTabbedPaneUI());
tabs.setFocusable(false);
tabs.setBackground(ViewUtil.getLightGrayBackgroundColor());

代码示例来源:origin: senbox-org/snap-desktop

@Override
protected JTabbedPane createMainPanel() {
  this.tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
  this.tabbedPane.setBorder(BorderFactory.createEmptyBorder());
  Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  double widthRatio = 0.5;
  formWidth = Math.max((int) (screenSize.width * widthRatio), MIN_TABBED_WIDTH);
  double heightRatio = 0.5;
  int formHeight = Math.max((int) (screenSize.height * heightRatio), MIN_TABBED_HEIGHT);
  tabbedPane.setPreferredSize(new Dimension(formWidth, formHeight));
  getJDialog().setMinimumSize(new Dimension(formWidth + 16, formHeight + 72));
  addTab(tabbedPane, Bundle.CTL_Panel_OperatorDescriptor_Text(), createDescriptorTab());
  currentIndex++;
  addTab(tabbedPane, Bundle.CTL_Panel_ConfigParams_Text(), createToolInfoPanel());
  currentIndex++;
  addTab(tabbedPane, Bundle.CTL_Panel_PreProcessing_Border_TitleText(), createPreProcessingTab());
  currentIndex++;
  addTab(tabbedPane, Bundle.CTL_Panel_OpParams_Border_TitleText(), createParametersTab(formWidth));
  currentIndex++;
  addTab(tabbedPane, Bundle.CTL_Panel_SysVar_Border_TitleText(), createVariablesPanel());
  currentIndex++;
  addTab(tabbedPane, Bundle.CTL_Panel_Bundle_TitleText(), createBundlePanel());
  currentIndex++;
  tabbedPane.setUI(new BasicTabbedPaneUI());
  formWidth = tabbedPane.getTabComponentAt(0).getWidth();
  return tabbedPane;
}

相关文章

JTabbedPane类方法