<****** language="JavaScript" type="text/**********"> ******> Hide Menu Show Menu - Link 1 - Link 2 - Link 3 - Link 4 - Link 5 - Link 6 - x
APLET ŞEKLİNDE MENÜ
/* */ import java.awt.* ; import java.awt.event.*; import java.applet.*; import java.util.*; import java.net.*; public class ImageMenu extends Applet { Dimension d; Image img, off; Graphics offg; int MAXITEMS = 64; String url[] = new String[MAXITEMS]; String target[] = new String[MAXITEMS]; String urlPrefix, urlSuffix; int selectedCell = -1; int oldCell = -1; int cellH; int cells; public void init() { d = getSize(); urlPrefix = getParameter("urlPrefix"); urlSuffix = getParameter("urlSuffix"); StringTokenizer st; st = new StringTokenizer(getParameter("urlList"), "+"); int i=0; while(st.hasMoreTokens() && i < MAXITEMS) url[i++] = st.nextToken(); cells = i; cellH = d.height/cells; st = new StringTokenizer(getParameter("targetList"), "+"); i=0; while(st.hasMoreTokens() && i < MAXITEMS) target[i++] = st.nextToken(); addMouseListener(new MyMouseAdapter()); addMouseMotionListener(new MyMouseMotionAdapter()); } private void lateInit() { off = createImage(d.width, d.height); try { img = getImage(getDocumentBase(), getParameter("img")); MediaTracker t = new MediaTracker(this); t.addImage(img, 0); t.waitForID(0); } catch(Exception e) { showStatus("error: " + e); } } public void update(Graphics g) {} public void paint(Graphics g) { if(off == null) lateInit(); offg = off.getGraphics(); offg.drawImage(img, 0, 0, this); if (selectedCell >= 0) { offg.clipRect(0, selectedCell * cellH, d.width, cellH); offg.drawImage(img, -d.width, 0, this); } g.drawImage(off, 0, 0, this); } class MyMouseMotionAdapter extends MouseMotionAdapter { public void mouseDragged(MouseEvent me) { mouseMoved(me); } public void mouseMoved(MouseEvent me) { int y = me.getY(); selectedCell = (int)(y/(double)d.height*cells); if (selectedCell != oldCell) { paint(getGraphics()); showStatus(urlPrefix + url[selectedCell] + urlSuffix); oldCell = selectedCell; } } } class MyMouseAdapter extends MouseAdapter { public void mouseExited(MouseEvent me) { selectedCell = oldCell = -1; paint(getGraphics()); showStatus(""); } public void mouseReleased(MouseEvent me) { URL u = null; try { u = new URL(urlPrefix + url[selectedCell] + urlSuffix); } catch(Exception e) { showStatus("error: " + e); } if (me.isShiftDown()) getAppletContext().showDocument(u, "_blank"); else getAppletContext().showDocument(u, target[selectedCell]); } } }
SAYI TAHMİN OYUNU APLET
import java.awt.*; import java.applet.*; import java.awt.event.*; public class so extends Applet { sayioyun oyun=new sayioyun(); TextArea output=new TextArea(17,32); TextField edit=new TextField(4); char c[]=oyun.sayiuret(); public void yenioyun(){ c=oyun.sayiuret(); } public static String kontrol(char veri[]){ String mesaj="ok"; if (veri.length!=4) mesaj="Lutfen 4 basamakli sayi giriniz.."; else { for(int i=0;i<4;i++){ for(int j=0;j
DİJİTAL SAAT
<****** language="JavaScript">