当前位置: 首页>>代码示例>>Java>>正文


Java JTabbedPane.TOP属性代码示例

本文整理汇总了Java中javax.swing.JTabbedPane.TOP属性的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPane.TOP属性的具体用法?Java JTabbedPane.TOP怎么用?Java JTabbedPane.TOP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.JTabbedPane的用法示例。


在下文中一共展示了JTabbedPane.TOP属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    frame = new JFrame("Library Book Loan System - My Books and Reservations");
    frame.setResizable(false);
    frame.setBounds(100, 100, 700, 400);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(null);
    
    JLabel label = new JLabel("Library Book Loan System");
    label.setHorizontalAlignment(SwingConstants.CENTER);
    label.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
    label.setBounds(10, 11, 674, 30);
    frame.getContentPane().add(label);
    
    JLabel lblBookReservations = new JLabel("My Books and Reservations");
    lblBookReservations.setHorizontalAlignment(SwingConstants.CENTER);
    lblBookReservations.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
    lblBookReservations.setBounds(10, 42, 674, 22);
    frame.getContentPane().add(lblBookReservations);
        
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setBackground(SystemColor.text);
    tabbedPane.setBounds(10, 75, 674, 228);
    frame.getContentPane().add(tabbedPane);
    
    initializeCurrentBooks(tabbedPane);
    initializeWaitlist(tabbedPane);
    initializeHistory(tabbedPane);
    
    frame.setVisible(true);
}
 
开发者ID:hisener,项目名称:bbm487s2017g1,代码行数:33,代码来源:CustomerMyBooksAndReservationsWindow.java

示例2: createTabbedPane

private static JTabbedPane createTabbedPane(JPanel basePanel, JPanel adminPanel) {
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    
    tabbedPane.addTab(
        getMessage("PropertiesDialog.BasePanelTitle"),
        /* icon */ null, basePanel,
        getMessage("PropertiesDialog.BasePanelHint"));
            
    tabbedPane.addTab(
        getMessage("PropertiesDialog.AdminPanelTitle"),
        /* icon */ null, adminPanel,
        getMessage("PropertiesDialog.AdminPanelHint"));
    
    tabbedPane.getAccessibleContext().setAccessibleName(
            getMessage("PropertiesDialog.ACS_Name"));
    tabbedPane.getAccessibleContext().setAccessibleDescription(
            getMessage("PropertiesDialog.ACS_Desc"));

    
    return tabbedPane;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:PropertiesDialog.java

示例3: store

protected boolean store() {
    prefs.putBoolean(WinSysPrefs.EDITOR_CLOSE_ACTIVATES_RECENT, isCloseActivatesMostRecentDocument.isSelected());
    prefs.putBoolean(WinSysPrefs.OPEN_DOCUMENTS_NEXT_TO_ACTIVE_TAB, isNewDocumentOpensNextToActiveTab.isSelected());
    
    boolean needsWinsysRefresh = false;
    needsWinsysRefresh = checkMultiRow.isSelected() != defMultiRow;
    prefs.putBoolean(WinSysPrefs.DOCUMENT_TABS_MULTIROW, checkMultiRow.isSelected());

    int tabPlacement = JTabbedPane.TOP;
    if( radioBottom.isSelected() )
        tabPlacement = JTabbedPane.BOTTOM;
    else if( radioLeft.isSelected() )
        tabPlacement = JTabbedPane.LEFT;
    else if( radioRight.isSelected() )
        tabPlacement = JTabbedPane.RIGHT;
    prefs.putInt( WinSysPrefs.DOCUMENT_TABS_PLACEMENT, tabPlacement );
    needsWinsysRefresh |= tabPlacement != defTabPlacement;

    return needsWinsysRefresh;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:TabsPanel.java

示例4: Gui

public Gui() throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
	UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
	frame = new JFrame("ElectroLight Penetration Testing");
	menuBar = new JMenuBar();
	frame.setJMenuBar(menuBar);
	
	JMenu mnCounterhack = new JMenu("Counter-hack");
	menuBar.add(mnCounterhack);
	
	JMenuItem mntmArpScan = new JMenuItem("ARP Scan");
	mnCounterhack.add(mntmArpScan);
	frame.setSize(300, 200);
	
	JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
	frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
	
	// Always keep the 2 following lines at the end.
	//frame.pack();
	frame.setVisible(true);
}
 
开发者ID:Electro-Light,项目名称:ElectroLight-Penetration-Testing,代码行数:20,代码来源:Gui.java

示例5: initDialog

void initDialog() {
	dialog = new JDialog( 
//	dialog = new JFrame(
		(JFrame)grid.getTopLevelAncestor(), 
		"Grid Rendering Tools");
	tabs = new JTabbedPane(JTabbedPane.TOP);
	tabs.add( "Rendering", this);
	dialog.getContentPane().add(tabs);
	JLabel label = new JLabel("Rendering tools are new "
			+"and still under development - "
			+"use with caution");
	dialog.getContentPane().add(label, "South");
	dialog.pack();
	tabs.add( "3D", pers);
	tabs.addChangeListener( new ChangeListener() {
		public void stateChanged(ChangeEvent e) {
			tabChange();
		}
	});
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:20,代码来源:RenderTools.java

示例6: initialize

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
	frame = new JFrame();
	frame.setBounds(100, 100, 450, 300);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.getContentPane().setLayout(new GridLayout(1, 0, 0, 0));

	JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
	frame.getContentPane().add(tabbedPane);

	JScrollPane scrollPane = new JScrollPane();
	tabbedPane.addTab("New tab", null, scrollPane, null);

	JScrollPane scrollPane_1 = new JScrollPane();
	tabbedPane.addTab("New tab", null, scrollPane_1, null);
}
 
开发者ID:FlyArts,项目名称:NovelJ,代码行数:18,代码来源:SettingsWindow_Windows.java

示例7: run

@Override
public void run() {
    JTabbedPane pane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    pane.addTab("first", new JButton("first"));
    pane.addTab("second", new JButton("second"));
    for (Component component : pane.getComponents()) {
        component.setSize(100, 100);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:Test6943780.java

示例8: ChooseFoundingFatherDialog

/**
 * The constructor that will add the items to this panel.
 *
 * @param freeColClient The {@code FreeColClient} for the game.
 * @param frame The owner frame.
 * @param possibleFoundingFathers The {@code FoundingFather}s
 *     which can be selected. The length of the array is the same
 *     as the number of {@code FoundingFather} categories and the
 *     values identifies a {@code FoundingFather} to be picked in
 *     each of those categories.
 */
public ChooseFoundingFatherDialog(FreeColClient freeColClient, JFrame frame,
        List<FoundingFather> possibleFoundingFathers) {
    super(freeColClient, frame);

    this.possibleFathers = possibleFoundingFathers;
    this.tb = new JTabbedPane(JTabbedPane.TOP);

    JButton helpButton = new JButton(freeColClient.getActionManager()
        .getFreeColAction("colopediaAction.fathers"));
    helpButton.setText(Messages.message("help"));

    FatherDetailPanel details = new FatherDetailPanel(freeColClient,
        new ColopediaPanel(freeColClient));
    for (FoundingFather father : possibleFoundingFathers) {
        JPanel jp = new MigPanel();
        details.buildDetail(father, jp);
        jp.validate();
        tb.addTab(Messages.message(father.getTypeKey()), jp);
    }
    tb.setSelectedIndex(0);

    MigPanel panel = new MigPanel(new MigLayout("wrap 1", "align center"));
    panel.add(Utility.localizedHeader("chooseFoundingFatherDialog.title", false));
    panel.add(helpButton, "tag help");
    panel.add(tb, "width 100%");
    panel.setPreferredSize(panel.getPreferredSize());

    List<ChoiceItem<FoundingFather>> c = choices();
    c.add(new ChoiceItem<>(Messages.message("ok"), (FoundingFather)null)
        .okOption().defaultOption());
    initializeDialog(frame, DialogType.QUESTION, false, panel, null, c);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:43,代码来源:ChooseFoundingFatherDialog.java

示例9: fireChanged

private void fireChanged() {
    boolean isChanged = false;
    if (checkShowFolderName.isSelected() != settings.isShowFolderName()
            || checkShowFullPath.isSelected() != settings.isShowFullPath()
            || checkProjectColors.isSelected() != settings.isSameProjectSameColor()
            || checkSortDocumentList.isSelected() != settings.isSortDocumentListByProject()) {
        isChanged = true;
    }
    
    int rowCount = settings.getRowCount();
    if (checkMultiRow.isSelected() && radioRowCount.isSelected()) {
        rowCount = ((Number) spinRowCount.getValue()).intValue();
    }
    if (checkMultiRow.isSelected() != (rowCount > 1 || settings.isTabRowPerProject())) {
        isChanged = true;
    }
    if (rowCount != settings.getRowCount()) {
        isChanged = true;
    }
    if (radioRowPerProject.isSelected() != settings.isTabRowPerProject()) {
        isChanged = true;
    }
    
    if(radioPlacementBottom.isSelected() && settings.getTabsLocation() != JTabbedPane.BOTTOM
            || radioPlacementLeft.isSelected() && settings.getTabsLocation() != JTabbedPane.LEFT
            || radioPlacementRight.isSelected() && settings.getTabsLocation() != JTabbedPane.RIGHT
            || radioPlacementTop.isSelected() && settings.getTabsLocation() != JTabbedPane.TOP) {
        isChanged = true;
    }
    controller.changed(null, isChanged);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:InnerTabsPanel.java

示例10: ZooInspectorNodeViewersPanel

/**
 * @param zooInspectorManager
 *            - the {@link ZooInspectorManager} for the application
 * @param nodeVeiwers
 *            - the {@link ZooInspectorNodeViewer}s to show
 */
public ZooInspectorNodeViewersPanel(
        ZooInspectorNodeManager zooInspectorManager,
        List<ZooInspectorNodeViewer> nodeVeiwers) {
    this.zooInspectorManager = zooInspectorManager;
    this.setLayout(new BorderLayout());
    tabbedPane = new JTabbedPane(JTabbedPane.TOP,
            JTabbedPane.WRAP_TAB_LAYOUT);
    setNodeViewers(nodeVeiwers);
    tabbedPane.addChangeListener(this);
    this.add(tabbedPane, BorderLayout.CENTER);
    reloadSelectedViewer();
}
 
开发者ID:l294265421,项目名称:ZooKeeper,代码行数:18,代码来源:ZooInspectorNodeViewersPanel.java

示例11: createTabBorder

static Border createTabBorder( JTable table, int tabsLocation ) {
    if( IS_AQUA ) {
        return BorderFactory.createMatteBorder( 1, 0, 0, 0, table.getGridColor());
    } else {
        if( tabsLocation != JTabbedPane.TOP )
            return BorderFactory.createMatteBorder( 1, 0, 0, 0, table.getGridColor());
    }
    return BorderFactory.createEmptyBorder();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:TabTableUI.java

示例12: JTabbedPaneDemo

public JTabbedPaneDemo() {
	tabbedPane = new JTabbedPane(JTabbedPane.TOP);
	// panel=new Panel();
	// panel.setBackground(Color.RED);
	// music=new JPanel();
	// music.setBackground(Color.green);
	tabbedPane.addTab("panel", new JLabel("标签"));
	tabbedPane.addTab("music", new Button("按钮"));
	add(tabbedPane);
	setBounds(500, 100, 500, 500);
	setVisible(true);
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
 
开发者ID:followwwind,项目名称:javase,代码行数:13,代码来源:JTabbedPaneDemo.java

示例13: CoursePanel

public CoursePanel() throws Exception
	{
//		this();
			//jtp.setBounds(100, 100, 300, 200);
			//jtp.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));
			//int ft_size=jtp.getFont().getSize();
			setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
			jtp = new JTabbedPane(JTabbedPane.TOP);
			
			cap=new CourseAssignmentPanel();
			
			cmp=new CourseMaterialPanel();
			
			caup=new CourseAssignmentUploadPanel(null, "");
			
			//cdfp=new CourseDiscussionForumPanel();
			
			cip=new CourseInfoPanel();
			
			jtp.add("Material", cmp);
			jtp.setForegroundAt(0, Color.WHITE);
			jtp.setBackgroundAt(0, Color.DARK_GRAY);
			jtp.add("Assignments", cap);
			jtp.setForegroundAt(1, Color.WHITE);
			jtp.setBackgroundAt(1, Color.DARK_GRAY);
			jtp.add("Upload Assignments", caup);
			jtp.setForegroundAt(2, Color.WHITE);
			jtp.setBackgroundAt(2, Color.DARK_GRAY);
			//jtp.add("Discussion Forum", cdfp);
			//jtp.setForegroundAt(3, Color.WHITE);
			//jtp.setBackgroundAt(3, Color.DARK_GRAY);
			jtp.add("Info", cip);
			jtp.setForegroundAt(3, Color.WHITE);
			jtp.setBackgroundAt(3, Color.BLACK);
			cip.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
			add(jtp);
	}
 
开发者ID:jtatia,项目名称:Course-Management-System,代码行数:37,代码来源:CoursePanel.java

示例14: CourseSpecificPanel

public CourseSpecificPanel() throws Exception {
	jtp = new JTabbedPane(JTabbedPane.TOP);
	
	//pdf=new ProfDiscussionForumPanel();
	
	pcm=new ProfCourseMaterialPanel();
	
	pci=new ProfCourseInfoPanel();
	
	pav=new ProfAssignmentViewPanel();
	
	pa=new ProfAssignmentPanel();
	
	jtp.add("Material", pcm);
	jtp.setForegroundAt(0, Color.WHITE);
	jtp.setBackgroundAt(0, Color.DARK_GRAY);
	jtp.add("Assignments", pa);
	jtp.setForegroundAt(1, Color.WHITE);
	jtp.setBackgroundAt(1, Color.DARK_GRAY);
	jtp.add("Upload Assignments", pav);
	jtp.setForegroundAt(2, Color.WHITE);
	jtp.setBackgroundAt(2, Color.DARK_GRAY);
	//jtp.add("Discussion Forum", pdf);
	//jtp.setForegroundAt(3, Color.WHITE);
	//jtp.setBackgroundAt(3, Color.DARK_GRAY);
	jtp.add("Info", pci);
	jtp.setForegroundAt(3, Color.WHITE);
	jtp.setBackgroundAt(3, Color.DARK_GRAY);
	pci.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
	add(jtp);
}
 
开发者ID:jtatia,项目名称:Course-Management-System,代码行数:31,代码来源:CourseSpecificPanel.java

示例15: TabTable

public TabTable( TabDataModel tabModel, int tabsLocation ) {
    this( TabTableModel.create(tabModel, tabsLocation),
            tabsLocation == JTabbedPane.TOP || tabsLocation == JTabbedPane.BOTTOM ? JTabbedPane.HORIZONTAL : JTabbedPane.VERTICAL );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:TabTable.java


注:本文中的javax.swing.JTabbedPane.TOP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。