Example usage for javax.swing JFrame setTitle

List of usage examples for javax.swing JFrame setTitle

Introduction

In this page you can find the example usage for javax.swing JFrame setTitle.

Prototype

public void setTitle(String title) 

Source Link

Document

Sets the title for this frame to the specified string.

Usage

From source file:support.TradingVolumeGui.java

private CategoryPlot createChartFrame(CategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart("Trading Volume", "Stock", "Volume, USD", dataset,
            PlotOrientation.HORIZONTAL, true, true, false);
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.DARK_GRAY);
    plot.setRangeGridlinePaint(Color.DARK_GRAY);
    plot.getRenderer().setSeriesPaint(0, Color.BLUE);

    JFrame frame = new JFrame();
    frame.setBackground(Color.WHITE);
    frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
    frame.setTitle("Hazelcast Jet Source Builder Sample");
    frame.setBounds(WINDOW_X, WINDOW_Y, WINDOW_WIDTH, WINDOW_HEIGHT);
    frame.setLayout(new BorderLayout());
    frame.add(new ChartPanel(chart));
    frame.setVisible(true);//from ww  w  .  j  a v a2s.c  o  m
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent windowEvent) {
            hzMap.removeEntryListener(entryListenerId);
        }
    });
    return plot;
}

From source file:UserInterface.FarmerRole.HumidityGraph.java

public HumidityGraph(double value, String type) {

    data = new DefaultValueDataset(value);
    final JFrame frame = new JFrame();
    meterPlot = new MeterPlot(data);
    frame.getContentPane().setLayout(new BorderLayout(5, 5));
    frame.setDefaultCloseOperation(3);/*from w  ww . j a v a2  s. c o  m*/
    frame.setTitle("Inventory Humidity");
    meterChart = new JFreeChart("Humidity Chart", JFreeChart.DEFAULT_TITLE_FONT, this.meterPlot, false);
    panelMeter = new ChartPanel(this.meterChart);
    frame.getContentPane().add(panelMeter, BorderLayout.CENTER);
    frame.setSize(700, 400);
    final Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
    frame.setVisible(true);

}

From source file:Interface.ResultadoJanela.java

public ResultadoJanela(List<Resultado> tar, List<Resultado> jac, List<Resultado> och, List<Resultado> sbi) {
    //  super("Resultado");
    CategoryDataset dataset;//from  w  w  w  . java2  s .c  om

    //---------------------gerando resultados tarantula-------------------------------------
    dataset = gerarDataset(tar, jac, och, sbi);
    JFreeChart chart = gerarGrafico(dataset);
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setDomainZoomable(true);

    JLabel lAjuda = new JLabel("Ajuda", JLabel.RIGHT);
    lAjuda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icone_informacao.gif"))); // NOI18N
    lAjuda.setPreferredSize(new Dimension(50, 50));
    lAjuda.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            lAjudaMouseClicked(evt);
        }
    });

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.add(lAjuda, BorderLayout.BEFORE_FIRST_LINE);
    panel.add(chartPanel, BorderLayout.LINE_START);
    JLabel lTabela = new JLabel("Tabela de Resultados", JLabel.CENTER);
    panel.add(lTabela, BorderLayout.SOUTH);

    JTable table = new JTable(criarValores(tar, jac, och, sbi), criarColunas());

    // Adiciona o JTable dentro do painel
    JScrollPane scrollPane = new JScrollPane(table);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

    panel.add(scrollPane, BorderLayout.SOUTH);

    JFrame frame = new JFrame();
    frame.setTitle("JLoc - Resultado");
    frame.setVisible(true);
    frame.add(panel);

    frame.pack();
    frame.setVisible(true);
}

From source file:freemrs.ChartPanelDraw.java

public ChartPanelDraw(java.util.List<Vitals> result, String type) {
    this.type = type;
    this.result = result;
    dataset = createTimeDataset();//from   w  w w.ja  v a2 s.  c  o  m
    chartPanel = createChart(dataset, type);

    JFrame f = new JFrame("Vital Plot"); //Jframe to draw the graph
    f.setTitle("Vital Plot");
    f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    f.setLayout(new BorderLayout(0, 5));
    f.add(chartPanel, BorderLayout.CENTER);
    f.setIconImage(new ImageIcon(getClass().getResource("/images/icon_transparent.png")).getImage());

    chartPanel.setHorizontalAxisTrace(true); //set properties of the graph 
    chartPanel.setVerticalAxisTrace(true);
    chartPanel.setMouseWheelEnabled(true);

    JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    panel.add(createTrace()); //Add components to panel
    panel.add(createDate());
    panel.add(createZoom());
    f.add(panel, BorderLayout.SOUTH);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
}

From source file:support.SystemMonitorGui.java

private XYPlot createChartFrame(XYSeries series) {
    XYSeriesCollection dataSet = new XYSeriesCollection();
    dataSet.addSeries(series);//from w  w  w .  ja  va2s . c om
    JFreeChart chart = ChartFactory.createXYLineChart("Memory Allocation Rate", "Time (ms)",
            "Allocation Rate (MB/s)", dataSet, PlotOrientation.VERTICAL, true, true, false);
    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.DARK_GRAY);
    plot.setRangeGridlinePaint(Color.DARK_GRAY);
    plot.getRenderer().setSeriesPaint(0, Color.BLUE);

    JFrame frame = new JFrame();
    frame.setBackground(Color.WHITE);
    frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
    frame.setTitle("Hazelcast Jet Source Builder Sample");
    frame.setBounds(WINDOW_X, WINDOW_Y, WINDOW_WIDTH, WINDOW_HEIGHT);
    frame.setLayout(new BorderLayout());
    frame.add(new ChartPanel(chart));
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent windowEvent) {
            hzMap.removeEntryListener(entryListenerId);
        }
    });
    frame.setVisible(true);
    return plot;
}

From source file:com.jidesoft.spring.richclient.docking.JideApplicationWindow.java

/**
  * Overrides the applyStandardLayout by removing the 
  * setting of the layout manager and the insertion of
  * the center part of the frame. The JIDE docking framework
  * actually sets these, via the DefaultDockableHolder.
  *//* w  ww .  j a v a 2  s.  c o m*/
@Override
protected void applyStandardLayout(JFrame windowControl, ApplicationWindowConfigurer configurer) {
    this.logger.info("Applying standard layout");
    windowControl.setTitle(configurer.getTitle());
    windowControl.setIconImage(configurer.getImage());
    windowControl.setJMenuBar(createMenuBarControl());
    windowControl.getContentPane().add(createToolBarControl(), BorderLayout.NORTH);
    //windowControl.getContentPane().add(createStatusBarControl(), BorderLayout.SOUTH);
}

From source file:EHRAppointment.ChartPanelDraw.java

/**
 *
 * @param result//from  w ww .  ja v  a  2s. c o  m
 * @param type
 */
public ChartPanelDraw(java.util.List<Vitals> result, String type) {
    this.type = type;
    this.result = result;
    dataset = createTimeDataset();
    chartPanel = createChart(dataset, type);

    JFrame f = new JFrame("Vital Plot"); //Jframe to draw the graph
    f.setTitle("Vital Plot");
    f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    f.setLayout(new BorderLayout(0, 5));
    f.add(chartPanel, BorderLayout.CENTER);
    f.setIconImage(new ImageIcon(getClass().getResource("/images/icon_transparent.png")).getImage());

    chartPanel.setHorizontalAxisTrace(true); //set properties of the graph 
    chartPanel.setVerticalAxisTrace(true);
    chartPanel.setMouseWheelEnabled(true);

    JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    panel.add(createTrace()); //Add components to panel
    panel.add(createDate());
    panel.add(createZoom());
    f.add(panel, BorderLayout.SOUTH);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setVisible(true);
}

From source file:herramientas.Ecualizacion_histograma.java

private void controles() {
    final JFrame v = new JFrame();
    v.setSize(220, 120);/*from   www .  jav a2s. c om*/
    v.setVisible(true);
    v.setTitle("Controles");
    v.setResizable(false);

    JPanel panel = new JPanel();
    v.add(panel);

    JButton Hist = new JButton("Histograma");
    Hist.setSize(220, 30);
    panel.add(Hist);
    JButton Hist_ac = new JButton("Histograma Acumulativo");
    panel.add(Hist_ac);
    JButton Hist_ec = new JButton("Histograma Ecualizado");
    panel.add(Hist_ec);

    Hist.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            v.dispose();
            histograma();
        }
    });

    Hist_ac.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            v.dispose();
            histogramaAcumulativo();
        }
    });

    Hist_ec.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            //                ecualizacion();
            v.dispose();
            gestor_img.anadirImagen(ecualizacion());
        }
    });

}

From source file:Console.java

public Console(Process p) {
    JFrame frame = new JFrame();
    frame.setTitle("Console");
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation(screenSize.width / 2 - INITIAL_WIDTH / 2, screenSize.height / 2 - INITIAL_HEIGHT / 2);
    ConsoleTextArea cta = new ConsoleTextArea();
    JScrollPane scroll = new JScrollPane(cta);
    scroll.setPreferredSize(new Dimension(INITIAL_WIDTH, INITIAL_HEIGHT));
    frame.getContentPane().add(scroll);/*from   w  w  w  . j  a v a  2 s. co  m*/
    frame.pack();

    // From here down your shell should be pretty much
    // as it is written here!
    /*
     * Start up StdOut, StdIn and StdErr threads that write the output generated by the process
     * p to the screen, and feed the keyboard input into p.
     */
    so = new StdOut(p, cta);
    se = new StdOut(p, cta);
    StdIn si = new StdIn(p, cta);
    so.start();
    se.start();
    si.start();

    // Wait for the process p to complete.
    try {
        frame.setVisible(true);
        p.waitFor();
    } catch (InterruptedException e) {
        /*
         * Something bad happened while the command was executing.
         */
        System.out.println("Error during execution");
        System.out.println(e);
    }

    /*
     * Now signal the StdOut, StdErr and StdIn threads that the process is done, and wait for
     * them to complete.
     */
    try {
        so.done();
        se.done();
        si.done();
        so.join();
        se.join();
        si.join();
    } catch (InterruptedException e) {
        // Something bad happend to one of the Std threads.
        System.out.println("Error in StdOut, StdErr or StdIn.");
        System.out.println(e);
    }
    frame.setVisible(false);
}

From source file:coq.DebugUnivInconst.java

void showGraph(Graph g, boolean newWindow, String title, HashSet<String> highlightNodes) {
    FRLayout<String, String> layout = new FRLayout<String, String>(g);
    System.err.println("----- " + title + "------");
    System.out.println("#edges: " + g.getEdgeCount());
    System.out.println("#nodes: " + g.getVertexCount());
    System.err.println("-----------------------");
    int numV = g.getVertexCount();
    layout.setSize(new Dimension(Math.max(600, numV), Math.max(600, numV)));
    VisualizationViewer<String, String> vv = new VisualizationViewer<String, String>(layout);
    DefaultModalGraphMouse gm = new DefaultModalGraphMouse();
    gm.setMode(ModalGraphMouse.Mode.PICKING);
    vv.setGraphMouse(gm);//  ww  w  .j a va2  s  . c  om
    vv.getRenderContext().setVertexDrawPaintTransformer(new VertexColor(highlightNodes));
    vv.getRenderContext().setVertexFillPaintTransformer(new VertexColor(highlightNodes));
    vv.getRenderContext().setArrowDrawPaintTransformer(new EdgeColor());
    vv.getRenderContext().setArrowFillPaintTransformer(new EdgeColor());
    vv.getRenderContext().setEdgeDrawPaintTransformer(new EdgeColor());
    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<String>());
    vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);

    JFrame jd;
    if (newWindow || topUnivs == null) {
        jd = new JFrame();
        jd.setTitle(title);
        jd.setSize(new Dimension(1000, 800));
        // jd.pack();
    } else {
        jd = topUnivs;
    }

    if (topUnivs == null && !newWindow)
        topUnivs = jd;

    jd.getContentPane().removeAll();
    jd.getContentPane().add(vv);
    jd.setVisible(true);

}