Code example for JScrollPane

Methods: getViewport

0
      this.scrollPane.setViewportView(panel);
   } 
 
   public XMLPanel getViewPanel() { 
      if (scrollPane != null)
         return (XMLPanel) this.scrollPane.getViewport().getView();
 
      return null; 
   } 
 
   public XMLElement getActiveElement() { 
      XMLPanel p = getViewPanel();
      if (p != null) {
         XMLElement current = p.getOwner();
         if (current instanceof SpecialChoiceElement) {
            current = ((SpecialChoiceElement) current).getControlledElement();
         } else if (current instanceof ActivityTypesChoiceElement) {
            current = ((ActivityTypesChoiceElement) current).getControlledElement();
         } 
         return current;
Experience pair programming with AI  Get Codota for Java