javax.swing.JFrame.show()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中javax.swing.JFrame.show()方法的一些代码示例,展示了JFrame.show()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.show()方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:show

JFrame.show介绍

暂无

代码示例

代码示例来源:origin: spotbugs/spotbugs

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();
  }
}

代码示例来源:origin: stackoverflow.com

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();

代码示例来源:origin: stackoverflow.com

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... 
  } 
}

代码示例来源:origin: net.sf.ingenias/editor

public static void main(String args[]) {
 JFrame j = new JFrame();
 j.pack(); ;
 j.show();
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void show()
 {
  try { content_.setClosed(false); }
  catch(PropertyVetoException ex) { }
  super.show();
 }
}

代码示例来源:origin: jzy3d/jzy3d-api

public static JFrame frame(JPanel panel) {
  JFrame frame = new JFrame();
  windowExitListener(frame);
  frame.add(panel);
  frame.pack();
  frame.show();
  frame.setVisible(true);
  return frame;
}

代码示例来源:origin: apache/felix

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");
 }
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

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();
}

代码示例来源:origin: net.sf.ingenias/editor

public static void main(String args[]){
 JFrame f=new JFrame();
 f.getContentPane().add(new ScrolledTArea());
 f.pack();
 f.show();
}

代码示例来源:origin: org.fudaa.soft.fudaa-refonde/refonde-client

/**
  * 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();
 }
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

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();
}

代码示例来源:origin: jpos/jPOS

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();
    }
  }
};

代码示例来源:origin: stackoverflow.com

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();
     }
   });
 }

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static void main(String[] argv) {
  JFrame f = new JFrame();
  NavigationPanel bc;
  f.add(bc = new NavigationPanel());
  bc.setTitle("MedSavant");
  f.pack();
  f.show();
}

代码示例来源:origin: nativelibs4java/JNAerator

@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();
  }
}

代码示例来源:origin: jpos/jPOS

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();
}

代码示例来源:origin: stackoverflow.com

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(); 
    }
  });
}

代码示例来源:origin: net.sf.ingenias/editor

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();
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

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();
}

代码示例来源:origin: apache/axis2-java

public void show() {
  wizardComponents.updateComponents();
  this.setSize(600,600);
  Utilities.centerComponentOnScreen(this);
  super.show();
}
protected void setBottomVisible(boolean flag){

相关文章

JFrame类方法