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

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

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

Window.<init>介绍

暂无

代码示例

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

Window w=new Window(null)

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

Window w=new Window(null)
{
 @Override
 public void paint(Graphics g)
 {
  final Font font = getFont().deriveFont(48f);
  g.setFont(font);
  g.setColor(Color.RED);
  final String message = "Hello";
  FontMetrics metrics = g.getFontMetrics();
  g.drawString(message,
   (getWidth()-metrics.stringWidth(message))/2,
   (getHeight()-metrics.getHeight())/2);
 }
 @Override
 public void update(Graphics g)
 {
  paint(g);
 }
};
w.setAlwaysOnTop(true);
w.setBounds(w.getGraphicsConfiguration().getBounds());
w.setBackground(new Color(0, true));
w.setVisible(true);

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

public void handle(ActionEvent arg0) {
  Window w = new Window("My Window#"+counter);

代码示例来源:origin: openmrs/openmrs-core

Window window = new Window(frame);
frame.setVisible(true);
frame.setTitle("JUnit Test Credentials");

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

var win = new Window("window{text:'Progress',bounds:[100,100,400,150],bar:Progressbar{bounds:[20,20,280,31] , value:0,maxvalue:100}};");
win.show();

for(...){
  //do work here

  //update progress
  win.bar.value = ...;
}

win.close();

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

// Creating a progress bar window.
var w = new Window("palette");
var progress = progress_bar(w, 27);
var currentDoc = w.add("statictext");
currentDoc.text = "Processing " + document.name;
w.show();

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

function Window(id) {
 this.id = id;
 this.errorMessage = new ErrorMessage();
}
function ErrorMessage() {
  this.show = function () {};
  this.hide = function () {};
}
var window1 = new Window();
window1.errorMessage.show();

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

public class MyApplication extends Application {

  @Override
  public void init() {
    setMainWindow(new Window());

    ApplicationContext context = this.getContext();
    if (context instanceof WebApplicationContext) {
      WebBrowser webBrowser = ((WebApplicationContext) this.getContext()).getBrowser();

      Date now = webBrowser.getCurrentDate(); // Returns the current date and time on the browser
    }
  }
}

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

SwingUtilities.invokeLater(new Runnable() {
  public void run() {
    new Window();
  }
});

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

Window fooBarWindow = new Window(null);

String mcHammer = "Can't Touch This";

with(fooBarWindow, w -> {
   w.setAlwaysOnTop(true);
   w.setBackground(Color.yellow);
   w.setLocation(300, 300);

   w.setTitle(mcHammer); // can read local variables
   //mcHammer = "Stop!"; // won't compile - can't modify local variables
});

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

import com.vaadin.Application;
import com.vaadin.ui.*;

public class V6tm1Application extends Application {
  @Override
  public void init() {
    Window mainWindow = new Window("V6tm1 Application");
    Label label = new Label("Hello Vaadin!");
    mainWindow.addComponent(label);
    setMainWindow(mainWindow);
    setTheme(“mytheme”);
  }

}

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

chart.addListener(new PointClickListener() {
  @Override
  public void pointClick(PointClickEvent pointClickEvent) {
    Item item = pointItems.get(pointClickEvent.getPoint());

    Window popupWindow = new Window();
    // Add stuff to your window
    getWindow().addWindow(popupWindow);
  }
});

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

public class Main{
  Window win;

  public Main(){
    win = new Window();
    win.dialog();
  }
}

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

MenuBar menuBar = new MenuBar();
 final Window window = new Window();
 window.setContent(new Upload());
 menuBar.addItem("Caption", new Command()
 {
   @Override
   public void menuSelected(MenuItem selectedItem)
   {
     UI.getCurrent().addWindow(window);
   }
 });

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

@Override
public void init() {
  Window mainWindow = new Window("LoginApplication");

  Label label = new Label("Hello anonymous Vaadin user");
  if (getUser() != null) {
    // user has logged in
    label = new Label("Hello " + ((User) getUser()).getFullName() + ", language id is '" + user.getLanguageId() + "'");
  }
  mainWindow.addComponent(label);
  setMainWindow(mainWindow);
}

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

Button button = new Button("Click Me!");
button.setStyleName(Button.STYLE_LINK);
button.addClickListener(new Button.ClickListener() {
  public void buttonClick(ClickEvent event) {
    // open your sub window here
    Window sub = new Window("Subwindow");
    v.addWindow(sub);
  }
});

v.addComponent(button);

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

public class Test extends Object {
  public int someVariable = 0;
  public void setSomeVariable(int value) { someVariable = value; }
  public int getSomeVariable() { return someVariable; }
  public static void main(String ... args) {
    // give the window a reference to this object
    Test foo = new Test();
    Window window = new Window(foo);
  }
}

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

public void run() {
   EventQueue.invokeLater(new Runnable() {
     public void run() {
       try {
         Window window = new Window();
         window.frame.setVisible(true);
       } catch (Exception e) {
         e.printStackTrace();
       }
     }
   });
 }

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

public class MainMethod {       
   public static void main(String[] args) {
     int[] a = new int[]{1, 3, -1, -3, 5, 3, 6, 7};
     int w = 3;
     Window ob = new Window();
     ob.getValue(a, w);
   }
 }
 Answer: 3 3 5 5 6 7

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

Window window = new Window("Normal window");
window.setWidth("250px");
window.setHeight("180px");
window.addStyleName("my-window");
UI.getCurrent().addWindow(window);

相关文章

微信公众号

最新文章

更多

Window类方法