السلام عليكم ورحمة الله وبركاته
اليكم اخوانى طريقة تحويل ال applet to applacation
ولكن لابد من معرفة بعض النقاط اولا و هى :
1- ال init() method in applet is simillar to main() in application
2 - u need'nt initiate the applet the browser do it
3- application usual. derived from JFrame , but applet derived from JApplat
4- the size and visibleof application determined by setSize() and setVisible() methods via the application code
but the size of the applet should set within the HTML file and the browser make it visible
5- applet must be public
, واليكم طريقة تحويل ال applet to application
JFrame f = new JFrame();
Calculator ap1 = new Calculator();
f.getContentPane().add(ap1);
f.setTitle("alaa");
ap1.init();
ap1.start();
f.setSize(400,450);
f.setVisible(true);الشرح:
1- نضع ال main حيث لا يصلح application بدونها
2- ننشأ frame حتى تتضمن ال applet
3- ننشأ object من ال applet الذى نريد تحويلة و هو calculator فى كودنا هذا
4- نضع ال شححمثف فى ال frame
5- نعمل calling للدوال اتالية
init() , start() .
والله من وراء المقصــــــــد :D