Example usage for javax.swing JFrame getName

List of usage examples for javax.swing JFrame getName

Introduction

In this page you can find the example usage for javax.swing JFrame getName.

Prototype

public String getName() 

Source Link

Document

Gets the name of the component.

Usage

From source file:org.eclipse.wb.tests.designer.core.nls.SourceEclipseModernTest.java

public void test_parse() throws Exception {
    createAccessorAndProperties();/*from  w  ww.j av a 2  s . c om*/
    ContainerInfo frame = parseContainer("public class Test extends JFrame {", "  public Test() {",
            "    setTitle(Messages.frame_title);", "    setName(Messages.frame_name);", "  }", "}");
    NlsSupport support = NlsSupport.get(frame);
    // check that we have DirectSource
    ModernEclipseSource source;
    {
        AbstractSource[] sources = support.getSources();
        assertEquals(1, sources.length);
        source = (ModernEclipseSource) sources[0];
    }
    // check getBundleComment()
    assertEquals("Eclipse modern messages class", ReflectionUtils.invokeMethod(source, "getBundleComment()"));
    // check that "title" is correct
    frame.refresh();
    try {
        JFrame jFrame = (JFrame) frame.getObject();
        assertEquals("My JFrame", jFrame.getTitle());
        assertEquals("My name", jFrame.getName());
    } finally {
        frame.refresh_dispose();
    }
}