//ababian ///show unicode fonts //uni.java //will use a scrollbar import java.awt.*; import java.applet.*; public class uni extends Applet{ /** diplays different unicode fonts*/ byte line[][]=new byte[4][64]; int current=0; Scrollbar scroll; public void paint(Graphics g) { g.drawString("Unicode font #"+current,1,10); for (int i=0;i<4;i++) g.drawString(new String(line[i],current),1,30+20*i); } public void start() {} public void stop() {} public boolean handleEvent(Event evt) { switch (evt.id) { case Event.SCROLL_LINE_UP: case Event.SCROLL_LINE_DOWN: case Event.SCROLL_PAGE_UP: case Event.SCROLL_PAGE_DOWN: case Event.SCROLL_ABSOLUTE: current = ((Integer)evt.arg).intValue(); repaint(); } return super.handleEvent(evt); } public void init() { setBackground(new Color(180,180,255)); for (int i=0;i<256;line[i/64][i%64]=(byte)i++); scroll = new Scrollbar(Scrollbar.HORIZONTAL,0,10,0,255); setLayout(new BorderLayout()); add("South", scroll); } }