public static void main(String args[]) { JFrame frame = new JFrame(); frame.setTitle("Title"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton button = new JButton(); button.setText("Hello, World!"); frame.getContentPane().add(button, BorderLayout.CENTER); frame.setSize(200, 100); frame.pack(); frame.setVisible(true); frame.show(); } }
JFrame f = new JFrame(); f.setLayout(null); f.setDefaultCloseOperation(3); f.setSize(500, 500); JPanel p = new JPanel() { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Dimension arcs = new Dimension(15,15); int width = getWidth(); int height = getHeight(); Graphics2D graphics = (Graphics2D) g; graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); //Draws the rounded opaque panel with borders. graphics.setColor(getBackground()); graphics.fillRoundRect(0, 0, width-1, height-1, arcs.width, arcs.height);//paint background graphics.setColor(getForeground()); graphics.drawRoundRect(0, 0, width-1, height-1, arcs.width, arcs.height);//paint border } }; p.setBounds(10,10,100,30); p.setOpaque(false); f.getContentPane().setBackground(Color.red); f.add(p); f.show();
public class MyApplication { public static void main(String[] args) { JFrame f = new JFrame("Labels"); // Add components to // the frame here... f.pack(); f.show(); // Don't do any more GUI work here... } }
public static void main(String args[]) { JFrame j = new JFrame(); j.pack(); ; j.show(); }
public void show() { try { content_.setClosed(false); } catch(PropertyVetoException ex) { } super.show(); } }
public static JFrame frame(JPanel panel) { JFrame frame = new JFrame(); windowExitListener(frame); frame.add(panel); frame.pack(); frame.show(); frame.setVisible(true); return frame; }
public static void main(String args[]) { if (args.length > 0) { JFrame f = new test(args[0]); f.setSize(300, 300); f.show(); } else { System.err.println( "You must specify an image filename to display"); } }
public static void main(String[] args) { JFrame frame = new JFrame("Test"); frame.getContentPane().setLayout(new BorderLayout()); JTextField text = new JTextField(10); frame.getContentPane().add("Center", text); frame.getContentPane().add("East", new ScrollButtonPanel(text)); frame.pack(); frame.show(); }
public static void main(String args[]){ JFrame f=new JFrame(); f.getContentPane().add(new ScrolledTArea()); f.pack(); f.show(); }
/** * Pour test. */ public static void main(String[] args) { JFrame f= new JFrame("Recentrer la vue"); RefondePnRecentrerNoeud pn= new RefondePnRecentrerNoeud(); f.getContentPane().add(pn, BorderLayout.CENTER); f.pack(); f.show(); } }
public static void main(String[] args) { JFrame frame = new JFrame("Test"); frame.getContentPane().setLayout(new FlowLayout()); frame.getContentPane().add(new ArrowButton(Color.black, Color.blue, UP)); frame.getContentPane().add(new ArrowButton(Color.black, Color.blue, RIGHT)); frame.setSize(100, 100); frame.show(); }
public void mouseClicked(MouseEvent e) { ISOMsg m = (ISOMsg) logList.getSelectedValue(); if (m != null) { JFrame f = new JFrame(m.toString()); ISOMsgPanel p = new ISOMsgPanel(m); f.getContentPane().add(p); f.pack(); f.show(); } } };
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame f = new JFrame(); NewJPanel n1 = new NewJPanel(); f.getContentPane().add(n1, BorderLayout.CENTER); f.pack(); f.show(); } }); }
public static void main(String[] argv) { JFrame f = new JFrame(); NavigationPanel bc; f.add(bc = new NavigationPanel()); bc.setTitle("MedSavant"); f.pack(); f.show(); }
@SuppressWarnings("deprecation") public static void main(String args[]) { JFrame f=new JFrame("Test"); String text=args.length==0 ? "" : ReadText.readText(new File(args[0])); JEditTextArea ta=new JEditTextArea(); ta.setText(text); f.getContentPane().add("Center",new JScrollPane(ta)); f.pack(); f.show(); } }
public void showLogList() { JFrame f = new JFrame(parent.getSymbolicName()); f.getContentPane().add(createLogList()); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); f.validate(); f.pack(); f.setSize(width,width+50); f.show(); }
public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new ButtonFrame(); frame.show(); } }); }
public static void main(String args[]){ JFrame jp= new JFrame(); Entity mient=new Entity("1"); CustomJLabel cl=new CustomJLabel(mient); jp.getContentPane().add(cl); jp.pack(); jp.show(); mient.setId("3"); cl.repaint(); }
public static void main(String[] argv) { JFrame f = new JFrame(); VCFUploadApp app = new VCFUploadApp(); f.setPreferredSize(new Dimension(400, 400)); f.setMinimumSize(new Dimension(400, 400)); app.viewWillLoad(); f.add(app.getView()); f.pack(); f.show(); app.viewDidLoad(); }
public void show() { wizardComponents.updateComponents(); this.setSize(600,600); Utilities.centerComponentOnScreen(this); super.show(); } protected void setBottomVisible(boolean flag){