Results 1 to 1 of 1

Thread: setStyleName ????????

  1. #1

    Default setStyleName ????????

    ExtGWT 1.2.2??????CSS?????????

    ????? color?????? font-size???????

    * .furigana2 {
    font-family: "Kochi Mincho, sans-serif";
    font-size: 12pt;
    color: purple;
    top: auto;
    vertical-align: text-top;
    z-index: 0;
    }

    ???setStyleAttribute("fontSize","12px"); ?????????????????????


    ???ok?????
    Code:
    private void testFurigana() {
    
            String kanji[] = { "???", "??", "????" };
            String furigana[] = { "????", "?", "?" };
            LabelField furi_label[] = new LabelField[furigana.length];
            LabelField kanji_label[] = new LabelField[furigana.length];
            HorizontalPanel horizontal_panel = null;
            VerticalPanel veritical_panel[] = new VerticalPanel[furigana.length];
    
            horizontal_panel = new HorizontalPanel();
            horizontal_panel.setSpacing(0);
            horizontal_panel.setAutoWidth(true);
             
            
            for (int i = 0; i < furigana.length; i++) {
    
                veritical_panel[i] = new VerticalPanel();
                veritical_panel[i].setSpacing(0);
                veritical_panel[i].setAutoWidth(true);
              
                furi_label[i] = new LabelField();
                furi_label[i].setHeight("11px");
                furi_label[i].setText(furigana[i]);
                furi_label[i].setStyleName("furigana2");
                furi_label[i].setStyleAttribute("fontSize","12px");
                veritical_panel[i].add(furi_label[i]);
    
                kanji_label[i] = new LabelField();
                kanji_label[i].setAutoHeight(true);
                kanji_label[i].setAutoWidth(true);
                kanji_label[i].setText(kanji[i]);
                
                kanji_label[i].setStyleAttribute("fontSize","20px");
                kanji_label[i].setLabelStyle("sentence2");
                kanji_label[i].setAutoWidth(false);
                veritical_panel[i].add(kanji_label[i]);
    
                horizontal_panel.add(veritical_panel[i]);
    
            }
            
            RootPanel.get("furigana_test").add(horizontal_panel);
    
        }
    ??????
    Code:
    for (int i = 0; i < furigana.length; i++) {
    
                veritical_panel[i] = new VerticalPanel();
                veritical_panel[i].setSpacing(0);
                veritical_panel[i].setAutoWidth(true);
              
                furi_label[i] = new LabelField();
                furi_label[i].setHeight("11px");
                furi_label[i].setText(furigana[i]);
                furi_label[i].setStyleName("furigana2");
            //    furi_label[i].setStyleAttribute("fontSize","12px");  <------------------------
                veritical_panel[i].add(furi_label[i]);
    
                kanji_label[i] = new LabelField();
                kanji_label[i].setAutoHeight(true);
                kanji_label[i].setAutoWidth(true);
                kanji_label[i].setText(kanji[i]);
                
            //    kanji_label[i].setStyleAttribute("fontSize","20px");  <===========================
                kanji_label[i].setLabelStyle("sentence2");
                kanji_label[i].setAutoWidth(false);
                veritical_panel[i].add(kanji_label[i]);
    
                horizontal_panel.add(veritical_panel[i]);
    
            }
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •