Пример #1
0
  public Component getPreview(WebLookAndFeelDemo owner) {
    WebTabbedPane tabbedPane1 = new WebTabbedPane();
    tabbedPane1.setPreferredSize(new Dimension(150, 100));
    tabbedPane1.setTabPlacement(WebTabbedPane.TOP);
    setupTabbedPane(tabbedPane1);

    WebTabbedPane tabbedPane2 = new WebTabbedPane();
    tabbedPane2.setPreferredSize(new Dimension(150, 100));
    tabbedPane2.setTabPlacement(WebTabbedPane.BOTTOM);
    setupTabbedPane(tabbedPane2);

    WebTabbedPane tabbedPane3 = new WebTabbedPane();
    tabbedPane3.setPreferredSize(new Dimension(150, 120));
    tabbedPane3.setTabPlacement(WebTabbedPane.LEFT);
    setupTabbedPane(tabbedPane3);

    WebTabbedPane tabbedPane4 = new WebTabbedPane();
    tabbedPane4.setPreferredSize(new Dimension(150, 120));
    tabbedPane4.setTabPlacement(WebTabbedPane.RIGHT);
    setupTabbedPane(tabbedPane4);

    return new GroupPanel(
        4,
        false,
        new GroupPanel(4, tabbedPane1, tabbedPane2),
        new GroupPanel(4, tabbedPane3, tabbedPane4));
  }
Пример #2
0
  public void initComponents() {
    // setting frame
    setTitle("Opcje");
    setResizable(false);

    setDefaultCloseOperation(WebFrame.DISPOSE_ON_CLOSE);
    setRound(10);
    setShadeWidth(0);
    ComponentMoveAdapter.install(this);
    setShowMinimizeButton(false);

    // creating tab pane
    tabGroupPane = new WebTabbedPane();
    tabGroupPane.setTabPlacement(WebTabbedPane.TOP);
    tabGroupPane.setTabbedPaneStyle(TabbedPaneStyle.standalone);
    tabGroupPane.setRound(10);
    tabGroupPane.setFocusable(false);

    // content border
    final TitledBorderPainter titledBorderPainter = new TitledBorderPainter();
    titledBorderPainter.setTitleOffset(10);
    titledBorderPainter.setRound(Math.max(0, 8));
    titledBorderPainter.setMargin(10);
    titledBorderPainter.setWidth(0);
    // this.setPainter(titledBorderPainter);

    // adding main options tab
    mainOptionsTab = new MainOptionsTab();
    mainOptionsTab.setPainter(titledBorderPainter);
    tabGroupPane.add(mainOptionsTab);

    // adding notification options tab
    notificationsOptionTab = new NotificationsOptionTab();
    notificationsOptionTab.setPainter(titledBorderPainter);
    tabGroupPane.add(notificationsOptionTab);

    add(tabGroupPane);

    // inside padding
    tabGroupPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    // -------------------------------FINAL-------------------------------//
    setBounds(new Rectangle(getPreferredSize()));

    // getting windows size
    Dimension scrnSize = Toolkit.getDefaultToolkit().getScreenSize();
    int width = (int) scrnSize.getWidth();
    int height = (int) scrnSize.getHeight();

    // getting taksbar size
    Rectangle winSize = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
    int taskBarHeight = scrnSize.height - winSize.height;

    // setting ui location on screen
    int xLocation = (width - (int) getPreferredSize().getWidth()) / 2;
    int yLocation = (height - (int) getPreferredSize().getHeight() - taskBarHeight) / 2;
    setLocation(xLocation, yLocation);
  }
Пример #3
0
  @Override
  public Component prepareView() {
    tabPan = new WebTabbedPane();
    tabPan.setOpaque(false);
    tabPan.setTabPlacement(WebTabbedPane.TOP);

    tabPan.addTab("  Enter Hour Details   ", getForm());

    return tabPan;
  }