Tuesday, August 17, 2010

ජාවා programm එකකට look & feel යෙදීම.

         java ගැන ඕන තරම් බ්ලොග් ලියල තියෙන නිසා වැඩිදුර විස්තර කරන්නෙ නැතිව යමක් කියල දෙන්නම් කෝ. මෙන්න තියෙනවා ජාවා programm එකකට look & feel දාගන්න හැටි. UIManager.setLookAndFeel(new WindowsLookAndFeel()); කියන්නෙ තීම් එක සෙට් කරන කෝඩ් එක.පහලින් තියෙන කෝඩ් එක main method එකේ හරි constructor එකේ මුලින්ම හරි දාගන්න.

         ඔයාලට system එකේ difault theme එක දාගන්න ඕනිනම් UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
code එක try catch එක අතුලෙ දාගන්න. එත්කොට ඔයාලගෙ system os එකේ default තීම් එක software එකට දාගන්න පුලුවන්.


        try {
            UIManager.setLookAndFeel(new WindowsLookAndFeel());
        } catch (Exception e) {
             e.printStackTrace();
        }
     

No comments:

Post a Comment