Java 8 AppletContext - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AppletContext class.

This code example shows how to use the following methods:getApplet
  @Test
  public void should_get_applet() { 
    AppletContext context = mock(AppletContext.class);
    Applet applet = mock(Applet.class);
    String name = "applet";
    when(target.getAppletContext()).thenReturn(context);
    when(context.getApplet(name)).thenReturn(applet);
    assertThat(driver.getApplet(name)).isSameAs(applet);
  } 
 
  @Test
  @SuppressWarnings("unchecked") 
  public void should_get_applets() { 
    AppletContext context = mock(AppletContext.class);
    Enumeration<Applet> applets = mock(Enumeration.class);
    when(target.getAppletContext()).thenReturn(context);
    when(context.getApplets()).thenReturn(applets);
    assertThat(driver.getApplets()).isSameAs(applets);
  } 
} 
5
CodeRank
This code example shows how to use the following methods:showDocument, toString
    public void start() { 
         
        _context = getAppletContext();
         
        if(_match) {
            _midiAccess = new MIDIAccess(_context);
            _midiSequencer = new MIDISequencer(_context);
        } 
        System.out.println("[start] " + _context.toString() + " : " + System.getProperty("java.version") + " : " + System.getProperty("java.vendor"));
        String url;
        if (_match) {
            url = "javascript:midiBridge.ready()";
        } else { 
            url = "javascript:midiBridge.error('Please update your Java plugin (your version: " + System.getProperty("java.version") + " required version: " + getParameter("minJavaVersion") + ")')";
        } 
         
        try { 
            _context.showDocument(new URL(url));
        } catch (MalformedURLException me) {
            System.out.println(me);

5
CodeRank
See Code Examples for Java 8 AppletContext Methods: