AWT components in the display Unicode characters

  Abstract: In the AWT components in the display Unicode characters 

  </ Td> </ tr> <tr> <td width="486" height="35" valign="top" class="ArticleTeitle"> import java.awt .*; 
  Import java.awt.event .*; 
  Import javax.swing .*; 

  Public class my_display extends Frame ( 
  Public static class MyCanvas extends Canvas ( 
  Public MyCanvas () ( 
  SetFont (new Font ( "Serif", Font.PLAIN, 36)); 
  ) 
  Public void paint (Graphics g) ( 
  String s = "\ u3041 \ u3042 \ u3043 \ u3044 \ u3045"; 
  G.drawString (s, 20, 50); 
  ) 
  ) 
  Public my_display () ( 
  Super ( "Unicode Tester"); 
  Add (new MyCanvas (), BorderLayout.CENTER); 
  Choice c = new Choice (); 
  C.addItem ( "\ u3041 \ u3042 \ u3043 \ u3044 \ u3045"); 
  C.addItem ( "\ u3041 \ u3042 \ u3043 \ u3044 \ u3046"); 
  Add (c, BorderLayout.SOUTH); 
  JTextField tf = new JTextField ( "\ u3041 \ u3042 \ u3043 \ u3044 \ u3045"); 
  Add (tf, BorderLayout.NORTH); 
  ) 
  Public static void main (String [] args) ( 
  Frame f = new my_display (); 
  F.addWindowListener (new WindowAdapter () ( 
  Public void windowClosing (WindowEvent e) ( 
  System.exit (0); 
  ) 
  )); 
  F.setSize (300, 150); 
  F.setVisible (true); 
  ) 
  ) </ Td> <td width="198" valign="top" class="ArticleTeitle"> 
  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags: ,

Releated Java Articles

Comments

Leave a Reply