当前位置: 首页>>代码示例>>Java>>正文


Java Sysout.println方法代码示例

本文整理汇总了Java中test.java.awt.regtesthelpers.Sysout.println方法的典型用法代码示例。如果您正苦于以下问题:Java Sysout.println方法的具体用法?Java Sysout.println怎么用?Java Sysout.println使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test.java.awt.regtesthelpers.Sysout的用法示例。


在下文中一共展示了Sysout.println方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runTestAWT

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
private static void runTestAWT(){
    KeyboardFocusManager currentKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    FocusTraversalPolicy defaultFTP = currentKFM.getDefaultFocusTraversalPolicy();
    ContainerOrderFocusTraversalPolicy newFTP = new ContainerOrderFocusTraversalPolicy();

    Frame frame = new Frame();
    Window window = new Window(frame);

    FocusTraversalPolicy resultFTP = window.getFocusTraversalPolicy();
    Sysout.println("FocusTraversalPolicy on window = " + resultFTP);
    /**
     * Note: this call doesn't affect already created components as they have
     * their policy initialized. Only new components will use this policy as
     * their default policy.
     **/
    Sysout.println("Now will set another policy.");
    currentKFM.setDefaultFocusTraversalPolicy(newFTP);
    resultFTP = window.getFocusTraversalPolicy();
    if (!resultFTP.equals(defaultFTP)) {
        Sysout.println("Failure! FocusTraversalPolicy should not change");
        Sysout.println("Was: " + defaultFTP);
        Sysout.println("Become: " + resultFTP);
        throw new RuntimeException("Failure! FocusTraversalPolicy should not change");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:DefaultPolicyChange_AWT.java

示例2: main

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
public static void main(String []s) {
    Frame frame = new SensibleFrame();

    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);

    Robot robot = Util.createRobot();
    Util.waitForIdle(robot);

    /* The defect may appear on every kind of mouse event: movement, press, etc.
     * so start mouse move from frame's outside. Use small threshhold depending on the
     * frame's size.
     */
    Point start = new Point(frame.getLocationOnScreen().x - frame.getWidth()/5,
                            frame.getLocationOnScreen().y - frame.getHeight()/5);
    Point end = new Point(frame.getLocationOnScreen().x + frame.getWidth() * 6 / 5,
                          frame.getLocationOnScreen().y + frame.getHeight() * 6 / 5);
    Sysout.println("start = " + start);
    Sysout.println("end = " + end);
    Util.mouseMove(robot, start, end);

    // Start drag inside toplevel.
    start = new Point(frame.getLocationOnScreen().x + frame.getWidth()/2,
                      frame.getLocationOnScreen().y + frame.getHeight()/2);
    end = new Point(frame.getLocationOnScreen().x + frame.getWidth() * 6 / 5,
                    frame.getLocationOnScreen().y + frame.getHeight() * 6 / 5);
    Util.drag(robot, start, end, MouseEvent.BUTTON1_MASK);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:30,代码来源:EventTimeInFuture.java

示例3: traceMouse

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
private void traceMouse(String k, MouseEvent e){
    long eventTime = e.getWhen();
    long currTime = System.currentTimeMillis();
    long diff = currTime - eventTime;

    Sysout.println(k + " diff is " + diff + ", event is "+ e);

    if (diff < 0){
        AbstractTest.fail(k + " diff is " + diff + ", event = "+e);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:EventTimeInFuture.java

示例4: traceKey

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
private void traceKey(String k, KeyEvent e){
    long eventTime = e.getWhen();
    long currTime = System.currentTimeMillis();
    long diff = currTime - eventTime;
    Sysout.println(k + " diff is " + diff + ", event is "+ e);
    if (diff < 0 ||
        diff > REASONABLE_PATH_TIME)
    {
        AbstractTest.fail(k + " diff is " + diff + ", event = "+e);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:CorrectTime.java

示例5: actionPerformed

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == showBtn) {
        fd.setFile(fileName);
        fd.setDirectory(dirPath);
        fd.setVisible(true);
        String output = fd.getFile();
        if (fileName.equals(output)) {
            Sysout.println("TEST PASSED");
        } else {
            Sysout.println("TEST FAILED (output file - " + output + ")");
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:FileNameOverrideTest.java

示例6: actionPerformed

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == showBtn) {
        fd.setVisible(true);
        String output = fd.getFile();
        if (output != null) {
            Sysout.println(output + " is selected");
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:FileDialogForPackages.java

示例7: actionPerformed

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == showBtn) {
        fd.setFile("input");
        fd.setDirectory(dirPath);
        fd.setVisible(true);
        String output = fd.getFile();
        if ("input".equals(output)) {
            Sysout.println("TEST PASSED");
        } else {
            Sysout.println("TEST FAILED (output file - " + output + ")");
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:SaveFileNameOverrideTest.java

示例8: runTestSwing

import test.java.awt.regtesthelpers.Sysout; //导入方法依赖的package包/类
private static void runTestSwing(){
    KeyboardFocusManager currentKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    FocusTraversalPolicy defaultFTP = currentKFM.getDefaultFocusTraversalPolicy();
    ContainerOrderFocusTraversalPolicy newFTP = new ContainerOrderFocusTraversalPolicy();


    JFrame jf = new JFrame("Test1");
    JWindow jw = new JWindow(jf);
    JDialog jd = new JDialog(jf);
    JPanel jp1 = new JPanel();
    JButton jb1 = new JButton("jb1");
    JTable jt1 = new JTable(new DefaultTableModel());

    jf.add(jb1);
    jf.add(jt1);
    jf.add(jp1);
    System.out.println("FTP current on jf= " + jf.getFocusTraversalPolicy());
    System.out.println("FTP current on jw= " + jw.getFocusTraversalPolicy());
    System.out.println("FTP current on jd= " + jd.getFocusTraversalPolicy());

    if (!(jf.getFocusTraversalPolicy() instanceof LayoutFocusTraversalPolicy) ||
        !(jw.getFocusTraversalPolicy() instanceof LayoutFocusTraversalPolicy) ||
        !(jd.getFocusTraversalPolicy() instanceof LayoutFocusTraversalPolicy))
    {
        throw new RuntimeException("Failure! Swing toplevel must have LayoutFocusTraversalPolicy installed");
    }

    jf.setVisible(true);

    System.out.println("Now will set another policy.");
    currentKFM.setDefaultFocusTraversalPolicy(newFTP);

    FocusTraversalPolicy resultFTP = jw.getFocusTraversalPolicy();

    System.out.println("FTP current on jf= " + jf.getFocusTraversalPolicy());
    System.out.println("FTP current on jw= " + jw.getFocusTraversalPolicy());
    System.out.println("FTP current on jd= " + jd.getFocusTraversalPolicy());

    if (!resultFTP.equals(defaultFTP)) {
        Sysout.println("Failure! FocusTraversalPolicy should not change");
        Sysout.println("Was: " + defaultFTP);
        Sysout.println("Become: " + resultFTP);
        throw new RuntimeException("Failure! FocusTraversalPolicy should not change");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:46,代码来源:DefaultPolicyChange_Swing.java


注:本文中的test.java.awt.regtesthelpers.Sysout.println方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。