Beispiel #1
0
  protected void createComponents() {
    main = new JPanel();
    main.setLayout(null);

    int divY = 42;

    BackgroundPanel div = new BackgroundPanel(hLine);
    div.setBounds(0, divY, 1920, 2);
    div.setStyle(BackgroundPanel.SCALED_X);

    JPanel tools = new JPanel(null);
    tools.setBounds(0, 0, 800, divY);

    bNew = new JButton("");
    bNew.setIcon(new ImageIcon(newButtonImage));
    bNew.setBorderPainted(false);
    bNew.setBounds(10, 10, newButtonImage.getWidth(null), newButtonImage.getHeight(null));

    search = new SearchTextField(searchHint, ElephantWindow.fontMedium);
    search.setBorder(BorderFactory.createEmptyBorder(0, 22, 0, 20));
    search.setBounds(newButtonImage.getWidth(null) + 10, 8, 160, 26);
    search.setFont(ElephantWindow.fontMedium);
    search.setFixedColor(Color.decode("#e9e9e9"));
    search.useV2();
    search.windowFocusGained();

    trash = new JButton("");
    trash.setBorderPainted(false);
    trash.setContentAreaFilled(false);
    trash.setIcon(new ImageIcon(noteToolsTrash));
    trash.setVisible(this instanceof Notebooks);
    trash.setBounds(
        newButtonImage.getWidth(null) + 177,
        10,
        noteToolsTrash.getWidth(null),
        noteToolsTrash.getHeight(null));

    tools.add(bNew);
    tools.add(search);
    tools.add(trash);

    scroll = new JScrollPane(main);
    scroll.setBorder(ElephantWindow.emptyBorder);
    scroll.getHorizontalScrollBar().setUnitIncrement(5);
    scroll.getVerticalScrollBar().setUnitIncrement(5);

    add(tools);
    add(div);
    add(scroll);

    addComponentListeners();
  }