SSISO Community

시소당

JEditorPane에 CSS스타일 인식하게하기

팁이라고  할수  도  있을것  같은데  JEditorPane에서  CSS를  인식하게  하는것이다.  아래와  같은  CSS를  자동으로  인식할수  있게  Kit객체에  CSS객체를  생성해서  add해준다.

  


        <link  href="case_builder.css"  rel="stylesheet"  type="text/css">

--------------------------

I've  tried  to  copy  the  rules  directly  in  the  document  instead  of  in  a  link  file  and  it  did  not  work  either.
        <style  type="text/css"><!--
        .menuitem  {
          font-family:  Verdana,  Arial,  Helvetica,  sans-serif;
          font-weight:  bold;
          color:  #003399;
        }
        -->    </style>
Not  working  either

-----------------------------------

I've  tried  to    create  the  rules  in  the  .java  did  not  work  either

                    helpContent  =  new  JEditorPane("text/html",  "");
                    HTMLEditorKit  kit  =  new  HTMLEditorKit();
                    helpContent.setEditorKit(kit);
                    StyleSheet  ssh  =  kit.getStyleSheet();
                    ssh.addRule(".menuitem  {  font-family:  Verdana;    }  ");
                    ssh.addRule(".menuitem  {  font-weight:  bold;    }  ");
                    ssh.addRule(".menuitem  {  color:  #003399;    }  ");

Not  working  either

[출처]  JEditorPane에  CSS스타일  인식하게하기|작성자  처리
http://blog.naver.com/ace772?Redirect=Log&logNo=120001592493

651 view

4.0 stars