zoukankan      html  css  js  c++  java
  • e830. 向JTabbedPane中加入一个卡片

    This example demonstrates various ways to add a tab to a tabbed pane.

        // Create a tabbed pane
        JTabbedPane pane = new JTabbedPane();
        
        // Add a tab with a label taken from the name of the component
        component1.setName("Tab Label");
        pane.add(component1);
        
        // Add a tab with a label at the end of all tabs
        String label = "Tab Label";
        pane.addTab(label, component2);
        
        // Add a tab with a label and icon at the end of all tabs
        Icon icon = new ImageIcon("icon.gif");
        pane.addTab(label, icon, component3);
        
        // Add a tab with a label, icon, and tool tip at the end of all tabs
        String tooltip = "Tool Tip Text";
        pane.addTab(label, icon, component4, tooltip);
        
        // Insert a tab after the first tab
        int index = 1;
        pane.insertTab(label, icon, component5, tooltip, index);
    
    Related Examples
  • 相关阅读:
    css问题
    前端性能优化整理
    算法之排序
    浅谈webpack优化
    js设计模式
    事件模型
    浏览器缓存
    ucGUI 12864 从打点起
    ucGUI例程收藏
    Qt 自动搜索串口号列表
  • 原文地址:https://www.cnblogs.com/borter/p/9596291.html
Copyright © 2011-2022 走看看