java.awt.Window.show()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(276)

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

Window.show介绍

[英]Makes the Window visible. If the Window and/or its owner are not yet displayable, both are made displayable. The Window will be validated prior to being made visible. If the Window is already visible, this will bring the Window to the front.
[中]

代码示例

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

for (int i = 0; i < ownedWindowList.size(); i++) {
     Window child = ownedWindowList.elementAt(i).get();
     if ((child != null) && child.showWithParent) { // Here theh flag is checked
       child.show();
       child.showWithParent = false; // flag is then reset
     }       // endif
   }

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

import javax.swing.*;

public class Main {
  public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.show();
  }
}

代码示例来源:origin: org.openspml/openspml

/**
 * Center a window over the screen, and display it.
 * This should be usable for JWindow, JFrame, and JDialog.
 */
public static void showWindow(Window window) {
centerWindow(window);
window.show();
}

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

import java.awt.*;
public class MainApplication {
  public static void main(String [] args) {
    Frame f = new Frame("Example 1");
    f.show();
  }
}

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

dispose();
Window rules = new Window( 700, 457, 2);
rules.show();

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

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class JFrame1 {
public static void main(String[] args) {
    JFrame frame = new JFrame();
    JButton btn1 = new JButton("Btn1");
    JButton btn2 = new JButton("Btn2");
    frame.setLayout(new BorderLayout());
    frame.setSize(500, 400);
    frame.add(btn1, BorderLayout.WEST);
    frame.add(btn2, BorderLayout.EAST);
    frame.show();
  }
}

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

// Create a window for full-screen mode; add a button to leave full-screen mode
Frame frame = new Frame(gs.getDefaultConfiguration());
Window win = new Window(frame);
Canvas c = new Canvas();
c.setBackground(Color.RED);
win.add(c);
win.show();  //or setVisible(true);

// Enter full-screen mode
gs.setFullScreenWindow(win);
win.validate();

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

import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class Stackkkk {
  public static void main(String[] args) {
    JFrame frame =new JFrame();
    frame.setSize(500, 200);
    frame.setLayout(new FlowLayout());
    frame.add(new JLabel("Name"));
    JTextField textfield=new JTextField();
    textfield.setPreferredSize(new Dimension(100, 50));
    frame.add(textfield);
    frame.show();
    //to stop the the program when jframe is closed 
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

}

代码示例来源:origin: org.openspml/openspml

public SOAPTracer(SpmlClient client) {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
    setClient(client);
  initComponents();
  this.show();
}
catch(Exception e) {
  e.printStackTrace();
}
}

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

import java.io.*;
import java.net.*;
import java.util.regex.*;
import javax.swing.*;

public class webloader {
  static JComponent page;
  public static void loadcode(){
    JEditorPane jep = new JEditorPane();
     jep.setEditable(false);   

     try {
      jep.setPage("http://(server):(port)/" + web.url);
     }
     catch (IOException e) {
      jep.setContentType("text/html");
      jep.setText("<html>Could not load webpage</html>");
     } 

     JScrollPane scrollPane = new JScrollPane(jep);     
     JFrame f = new JFrame(web.url);
     f.getContentPane().add(scrollPane);
     f.setSize(512, 342);
     f.show();
  }
}

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

f.getContentPane().add(scrollPane);
f.setSize(512, 342);
f.show();

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

f.getContentPane().add(scrollPane);
f.setSize(512, 342);
f.show();

代码示例来源:origin: com.stevesoft.pat/pat

public void SizeAndShow() {
  pack();
  Dimension d=getPreferredSize();
  setSize(d.width+100,d.height+200);
  modified = false;
  show();
}

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

import java.awt.*;
import java.awt.event.*;

public class AWTHello {
  public static void main(String argv[]) {
   Frame f = new Frame( "Hello world!" );
   f.addWindowListener( new WindowAdapter(){ public void windowClosing( WindowEvent e ){ System.exit( 0 ); } } );
   f.setSize( 300, 100 );
   f.show();
  }
}

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

import java.net.*;    
import java.awt.*;

public class QueenApl { 
 Image card;
 Frame frame;

 public static void main(String[] args){
   QueenApl f = new QueenApl();
 }

 public QueenApl(){
  frame = new Frame();
  frame.setSize(400,400);
  try{
   URL u = new URL("file:/c:/windows/desktop/carn4.jpg");
   card=frame.getToolkit().getImage(u);
  } catch(MalformedURLException e){
   System.out.println("Error in URL!"); System.exit(1);
  } 
  frame.show();
 }

 public void paint(Graphics g){
  g.drawImage(card,120,50,frame);
 }   
}

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

ListGrid list = new ListGrid();
//list configuration goes here
list.addClickHandler(new ClickHandler() {
  @Override
  public void onClick(ClickEvent event){
    //Get the clicked record
    Record row = list.getSelectedRecord();

    //Check if thats the record you want
    if(row != null && row.getAttribute("attribute").equals("thingToCheck"){            
      //Now just open the window
      Window window = new Window();
      //Configure here the window
      window.show();
    }
  }
});

代码示例来源:origin: com.stevesoft.pat/pat

public static void main(String[] unused) {
 Frame f = new Frame("Regex Tester");
 //f.addWindowListener(new ShutDown());
 f.resize(400,170);
 ReGap r = new ReGap();
 f.add(r);
 r.init();
 r.start();
 f.show();
}
/** @serial */

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

package com.businesslink.core.tst.ld.dct;

import java.awt.*;
import javax.swing.*;

public class SwgTestFrame1b
extends JFrame
{

public SwgTestFrame1b() {
  super("SwgTestFrame1b");

  setBackground(Color.white);
  setResizable(false);
  pack();
  }

static public void main(String[] args) {
  new SwgTestFrame1b().show();
  }
}

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

Window w = new Window();
w.setWidth(100);
w.setHeight(100);
w.setShowModalMask(false);
//
w.setIsModal(true);    
w.setDismissOnOutsideClick(true);
//
w.addItem(new Label("Test"));
w.show();

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

Window window = new Window();
window.setIsModal(true);
window.setWidth(800);
window.setHeight(500);
window.setAutoCenter(true);
window.setShowModalMask(true);

window.show();

final HLayout message = new HLayout();
message.setWidth(400);
message.setHeight(30);
message.addMember(new Label("hey you"));

message.setBackgroundColor("yellow");

message.bringToFront();
message.show();

相关文章

Window类方法