當前位置: 首頁>>代碼示例>>Java>>正文


Java JTabbedPane.setBounds方法代碼示例

本文整理匯總了Java中javax.swing.JTabbedPane.setBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java JTabbedPane.setBounds方法的具體用法?Java JTabbedPane.setBounds怎麽用?Java JTabbedPane.setBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JTabbedPane的用法示例。


在下文中一共展示了JTabbedPane.setBounds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialize

import javax.swing.JTabbedPane; //導入方法依賴的package包/類
/**
 * 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,代碼行數:34,代碼來源:CustomerMyBooksAndReservationsWindow.java

示例2: initialize

import javax.swing.JTabbedPane; //導入方法依賴的package包/類
/**
 * Initialize the contents of the frame.
 */
private void initialize(String username) {

    frame = new JFrame("Library Book Loan System - Librarian: " + username);
    frame.setResizable(false);
    frame.setBounds(100, 100, 586, 418);
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    
    JPanel panel = new JPanel();
    frame.getContentPane().add(panel, BorderLayout.CENTER);
    panel.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, 564, 25);
    panel.add(label);
    
    JLabel lblBookOperations = new JLabel("Book Operations");
    lblBookOperations.setHorizontalAlignment(SwingConstants.CENTER);
    lblBookOperations.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
    lblBookOperations.setBounds(10, 40, 564, 22);
    panel.add(lblBookOperations);
    
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setBackground(Color.LIGHT_GRAY);
    tabbedPane.setBounds(10, 73, 564, 295);
    panel.add(tabbedPane);


    initCreateTab(tabbedPane);
    initUpdateTab(tabbedPane);
    initDeleteTab(tabbedPane);
    initViewTab(tabbedPane);
}
 
開發者ID:hisener,項目名稱:bbm487s2017g1,代碼行數:38,代碼來源:LibrarianBookOperations.java


注:本文中的javax.swing.JTabbedPane.setBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。