|
Project Information
|
JavaScript Standard Widget Toolkit - graphical interface library was created as project for Master diploma in WSISiZ-WIT Poland. It is JavaScript library similar to Java SWT with major difference that the first one is working in web browser. Main idea was to create a group of controls with high level of interaction commonly known from desktop applications. Programming model is as close as possible related with Java SWT library. Thanks to this Java programmer should have no problems with using it. JSSWT is working in most of popular browsers (might be problem with some of controls). Unfortunately JSSWT is poorly documented (for idea of how JSSWT is organized SWT documentation will surely be helpful). Anyway if You are interested in using (or at least trying) this library visit wiki. Here You can see some widget examples:
Example code looks like that: 1 //create main object representing window
2 shell = new JSSWT.Shell();
3 shell.setLayout(new GridLayout(1,true));
4
5 //create main menu bar
6 menu = new JSSWT.Menu(shell,JSSWT.BAR);
7
8 //add items to menu bar
9 item1 = new JSSWT.MenuItem(menu,JSSWT.CASCADE);
10 item1.setText("&File");
11 item2 = new JSSWT.MenuItem(menu,JSSWT.CASCADE);
12 item2.setText("&Edit");
13
14 //associate menu with menuitem
15 menu1 = new JSSWT.Menu(item1,JSSWT.DROP_DOWN);
16 item3 = new JSSWT.MenuItem(menu1,JSSWT.PUSH);
17 item3.setText("&Open");
18 item3.setAccelerator(JSSWT.CONTROL|JSSWT.getCharCode('O'));
19 item3.setImage({src:"graphics/folder.png"});
20 item1.setMenu(menu1);
21 item4 = new JSSWT.MenuItem(menu1,JSSWT.CASCADE);
22 item4.setText("Open &recent");
23
24 menu2 = new JSSWT.Menu(item1,JSSWT.DROP_DOWN);
25 item5 = new JSSWT.MenuItem(menu2,JSSWT.PUSH);
26 item5.setText("JavaScript Standard Widget Toolkit.doc");
27 item5.setImage({src:"graphics/word.gif"});
28 item6 = new JSSWT.MenuItem(menu2,JSSWT.PUSH);
29 item6.setText("Performance statistics.doc");
30 item6.setImage({src:"graphics/excel.gif"});
31 item7 = new JSSWT.MenuItem(menu2,JSSWT.PUSH);
32 item7.setText("Inheritance in JavaScript.doc");
33 item7.setImage({src:"graphics/word.gif"});
34
35 item4.setMenu(menu2);
36 item1.setMenu(menu1);
37 shell.addMenu(menu);Maybe You will find it useful... Regards! Author |


