< prev index next >

src/java.desktop/share/classes/javax/swing/text/html/FrameView.java

Print this page




 201      * or by the frames enclosing frameset, the JScrollPane's setBorder()
 202      * method is invoked to achieve the desired look.
 203      */
 204     private void setBorder() {
 205 
 206         AttributeSet attributes = getElement().getAttributes();
 207         String frameBorder = (String)attributes.getAttribute(HTML.Attribute.FRAMEBORDER);
 208         if ((frameBorder != null) &&
 209             (frameBorder.equals("no") || frameBorder.equals("0"))) {
 210             // make invisible borders.
 211             scroller.setBorder(null);
 212         }
 213     }
 214 
 215 
 216     /**
 217      * This method creates the JScrollPane.  The scrollbar policy is determined by
 218      * the scrolling attribute.  If not defined, the default is "auto" which
 219      * maps to the scrollbar's being displayed as needed.
 220      */

 221     private void createScrollPane() {
 222         AttributeSet attributes = getElement().getAttributes();
 223         String scrolling = (String)attributes.getAttribute(HTML.Attribute.SCROLLING);
 224         if (scrolling == null) {
 225             scrolling = "auto";
 226         }
 227 
 228         if (!scrolling.equals("no")) {
 229             if (scrolling.equals("yes")) {
 230                 scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
 231                                            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
 232             } else {
 233                 // scrollbars will be displayed if needed
 234                 //
 235                 scroller = new JScrollPane();
 236             }
 237         } else {
 238             scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_NEVER,
 239                                        JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
 240         }




 201      * or by the frames enclosing frameset, the JScrollPane's setBorder()
 202      * method is invoked to achieve the desired look.
 203      */
 204     private void setBorder() {
 205 
 206         AttributeSet attributes = getElement().getAttributes();
 207         String frameBorder = (String)attributes.getAttribute(HTML.Attribute.FRAMEBORDER);
 208         if ((frameBorder != null) &&
 209             (frameBorder.equals("no") || frameBorder.equals("0"))) {
 210             // make invisible borders.
 211             scroller.setBorder(null);
 212         }
 213     }
 214 
 215 
 216     /**
 217      * This method creates the JScrollPane.  The scrollbar policy is determined by
 218      * the scrolling attribute.  If not defined, the default is "auto" which
 219      * maps to the scrollbar's being displayed as needed.
 220      */
 221     @SuppressWarnings("deprecation")
 222     private void createScrollPane() {
 223         AttributeSet attributes = getElement().getAttributes();
 224         String scrolling = (String)attributes.getAttribute(HTML.Attribute.SCROLLING);
 225         if (scrolling == null) {
 226             scrolling = "auto";
 227         }
 228 
 229         if (!scrolling.equals("no")) {
 230             if (scrolling.equals("yes")) {
 231                 scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
 232                                            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
 233             } else {
 234                 // scrollbars will be displayed if needed
 235                 //
 236                 scroller = new JScrollPane();
 237             }
 238         } else {
 239             scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_NEVER,
 240                                        JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
 241         }


< prev index next >