Пример #1
0
  public static void main(String[] args) {
    trial hello = new trial(1, "hi");
    JSearchPanel search =
        new JSearchPanel(
            hello.getVisualization(), NODES, Visualization.SEARCH_ITEMS, LABEL, true, true);
    search.setShowResultCount(true);

    search.setBorder(BorderFactory.createEmptyBorder(5, 5, 4, 0));

    // search.setBackground(ColorLib.getColor(0, 0, 255));
    // search.setForeground(ColorLib.getColor(0, 255, 255));

    final JFastLabel title = new JFastLabel("                 ");
    title.setPreferredSize(new Dimension(10, 10));
    title.setVerticalAlignment(SwingConstants.BOTTOM);
    title.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0));

    // title.setBackground(ColorLib.getColor(255, 0, 255));
    //  title.setForeground(ColorLib.getColor(0, 100, 255));

    JPanel box = new JPanel(new GridLayout(3, 1));
    //  box.add(Box.createHorizontalStrut(1));
    box.add(title);
    //  box.add(Box.createHorizontalGlue());
    box.add(search);
    // box.add(Box.createHorizontalStrut(1));
    //  box.setBackground(ColorLib.getColor(10, 0, 255));

    box.setSize(300, 100);

    JFrame frame = new JFrame("Dmoz");
    frame.add(box);
    frame.getContentPane().add(hello);

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocation(0, 0);
    frame.setSize(1200, 800);
    frame.setVisible(true);
  }