Example usage for javax.swing JFrame setResizable

List of usage examples for javax.swing JFrame setResizable

Introduction

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

Prototype

public void setResizable(boolean resizable) 

Source Link

Document

Sets whether this frame is resizable by the user.

Usage

From source file:ShowOff.java

public static void main(String[] args) {
    try {//  www.java  2  s. co m
        String filename = "largeJava2sLogo.jpg";
        String message = "Java Source and Support";
        int split = 4;
        JFrame f = new JFrame();
        f.getContentPane().setLayout(new BorderLayout());
        ShowOff showOff = new ShowOff(filename, message, split);
        f.add(showOff, BorderLayout.CENTER);
        f.setSize(f.getPreferredSize());
        f.setResizable(false);
        f.setVisible(true);
    } catch (Exception e) {
        System.out.println(e);
        System.exit(0);
    }
}

From source file:com.bsoft.baseframe.baseframe_utils.beanUtils.Classgenerator.java

/**
 * ??/*from  w  w w .jav  a2s. c  o m*/
 * @param args
 */
public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            JFrame frame = new Classgenerator();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            frame.setResizable(false);
        }
    });
}

From source file:Main.java

public static void main(String[] args) {
    final Timer timer;
    final JProgressBar progressBar = new JProgressBar();
    final JButton button = new JButton("Start");
    JFrame f = new JFrame();
    f.setLayout(new FlowLayout());
    f.add(progressBar);/*  w  w  w  .  java 2 s  .  co m*/
    f.add(button);

    ActionListener updateProBar = new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            int val = progressBar.getValue();
            if (val >= 100) {
                //  timer.stop();
                button.setText("End");
                return;
            }
            progressBar.setValue(++val);
        }
    };
    timer = new Timer(50, updateProBar);
    button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (timer.isRunning()) {
                timer.stop();
                button.setText("Start");
            } else if (button.getText() != "End") {
                timer.start();
                button.setText("Stop");
            }
        }
    });
    f.pack();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setResizable(false);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
}

From source file:Main.java

private static void createAndShowGui() {
    Main myPanel = new Main();
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(myPanel);
    frame.setResizable(false);
    frame.pack();/*from w  w  w.ja  v  a  2  s .c  o  m*/
    frame.setVisible(true);
}

From source file:com.bsoft.baseframe.baseframe_utils.beanUtils.Classgenerator.java

public static void init() {
    EventQueue.invokeLater(new Runnable() {
        @Override/* w  w w  .j a v  a 2s  .  c om*/
        public void run() {
            JFrame frame = new Classgenerator();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            frame.setResizable(false);
        }
    });
}

From source file:Main.java

public void buildGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame f = new JFrame();
    f.setResizable(false);
    removeMinMaxClose(f);//from w  w  w .j  a v a  2  s . c  o m
    JPanel p = new JPanel(new GridBagLayout());
    JButton btn = new JButton("Exit");
    p.add(btn, new GridBagConstraints());
    f.getContentPane().add(p);
    f.setSize(400, 300);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
    btn.addActionListener(e -> System.exit(0));
}

From source file:herramientas.Ecualizacion_histograma.java

private void controles() {
    final JFrame v = new JFrame();
    v.setSize(220, 120);/* ww w . j a  va2 s  . c o  m*/
    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:net.sourceforge.metware.binche.execs.BiNCheExec.java

private void runGui() {

    final JFrame window = new JFrame("binche Settings");
    final SettingsPanel settingsPanel = new SettingsPanel();
    window.getContentPane().add(settingsPanel);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setGlassPane(settingsPanel.getProgressPanel());
    window.pack();// w w w . j a  v  a 2  s .  c o  m

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    window.setLocation(screenSize.width / 2 - (window.getWidth() / 2),
            screenSize.height / 2 - (window.getHeight() / 2));
    window.setVisible(true);
    window.setResizable(true);
}

From source file:scheduler.benchmarker.manager.CreateCombinedSplineChart.java

private void createSubChart(ChartPanel chart) {
    JFrame frameGraph = new JFrame();
    frameGraph.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frameGraph.setForeground(new Color(76, 76, 76));
    frameGraph.setBackground(new Color(246, 244, 242));

    Dimension window = Toolkit.getDefaultToolkit().getScreenSize();
    if (window.width < 1074 && window.height < 800)
        frameGraph.setPreferredSize(new Dimension(window.width, window.height));
    else/*w  w  w. j  a v a  2 s .c o  m*/
        frameGraph.setPreferredSize(new Dimension(1074, 800));

    frameGraph.setLocation((window.width - frameGraph.getPreferredSize().width) / 2,
            (window.height - frameGraph.getPreferredSize().height) / 2);
    frameGraph.setResizable(true);
    frameGraph.add(chart);
    frameGraph.pack();
    frameGraph.setVisible(true);
}

From source file:scheduler.benchmarker.manager.CreateSimpleSplineChart.java

private void createSubChart(ChartPanel chart) {
    JFrame frameGraph = new JFrame();//new JFrame("FINAL RULES ARRANGEMENT");
    frameGraph.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frameGraph.setForeground(new Color(76, 76, 76));
    frameGraph.setBackground(new Color(246, 244, 242));

    Dimension window = Toolkit.getDefaultToolkit().getScreenSize();
    if (window.width < 1074 && window.height < 800)
        frameGraph.setPreferredSize(new Dimension(window.width, window.height));
    else//from www. j  av  a  2  s  . com
        frameGraph.setPreferredSize(new Dimension(1074, 800));

    frameGraph.setLocation((window.width - frameGraph.getPreferredSize().width) / 2,
            (window.height - frameGraph.getPreferredSize().height) / 2);
    frameGraph.setResizable(true);
    frameGraph.add(chart);
    frameGraph.pack();
    frameGraph.setVisible(true);
}