Monday, August 22, 2005

PHP issues

PHP syntax: to get a value of a variable from url, like: $url = "show_cat.php?catid=".($row["catid"]). The PHP script should be dealt with something like: $var=_REQUEST(“var”). if don’t do like this, you can’t get the value of the variable.
We can’t use reserve variable $PHP_SELF directly in PHP file, we should use $_SERVER['PHP_SELF'] instead. I think some version may support $PHP_SELF directly, I need to know this.
To judge some variable coming from a form of another webpage should use something like “ if (isset($_REQUEST['username']) && isset($_REQUEST['passwd']))”

Wednesday, July 13, 2005

about getImage() method

When use the method of Applet: getImage(), add the applet to a frame, and show a instance of the frame, if run it as application, it will show errors. We can use Toolkit.getImage() to replace Applet.getImage(). Also, the method of applet: getCodeBase() only can be used in applet(because getCodebase() is the URL of the applet itself), if add the applet with getCodeBase() to a frame, when run the instance of the frame as a application, it will show errors.

Monday, July 11, 2005

found sql driver for IBM J9

I have succeeded in on PDA using URL(*) to get the picture from httpserver today.
I try to find some api can make IBM J9 work with MySql. It seems there is not API for J9 to support the JDBC. I check the liberary of J9, found no java.sql.* inside.
Somebody say I can use JDBC Optional Package via the online update functionality, but How to?
I found a MySql Api(java.sql package) for j9, which is database_enabler_cldc.jar, but it is only suitable for the midp program design. can’t be used on code for CDC. It is said that there is Database_enabler.jar package in the jclMac comfiguration.At last, I use WSDD5.7.1 “update” function to download the file, and I succeeded. To get the file, should follow the path: Micro Environment Toolkit for Websphere Studio---Extension Service for Websphere Everyplace---Extension Service.
Today I also found a PDA emulator for window mobile 2003SE, which is convenient for development.

Saturday, July 09, 2005

IBM J9 doesn't support Bluetooth ?!

IBM J9 seems not to support Bluetooth API directly, I need to find a good way to support Bluetooth for J9. By far, I only get the information that Avetana Bluetooth software can work with J9 on PDA, but it is not free software.
Somebody say we can use RMI to communicate with Bluetooth port, I need to know RMI firstly.
Somebody say we can use the serial port which map to Bluetooth port, I don’t get the idea.

Thursday, July 07, 2005

success in getting picture from http server and display it

I have a new idea that I want to use apache as the server for my project. The apache server can work as: server for MySql+php, server for Java GUI, server for WebPage.
and I also knew: FileOutputStream is meant for writing streams of raw bytes such as image data, which means I can use FileOutputStream to output a image file. I succeed in getting the image and text file from the http server, and display them on the GUI(popup dialog).

Tuesday, July 05, 2005

Some functions about J9 JVM

I try to run the sun’s applet example on my PDA, the example I used it ArcTest which include main function. I found it can not run class directly, like: j9 -cp ArcTest.class,it doesn’t work.. However, it can run jar file, something like: 255#"\Program Files\J9\PPRO10\bin\j9.exe" "-jcl:ppro10" "-cp" "\applets\ArcTest\arcTest.jar" ArcTest. It does work., but I need to transfer the class file into jar file on PC firstly. I checked the sourcecode of ArcTest, It seems that J9 support java.awt.* and java.awt.event.*, which is a good news for my project. And I see a news say J9 doesn’t support the pen pointers. It is not a good news, because most situation, We need to use stylus to select buttons, lists, etc. see the link to get detail . and another news is J9 support CDC,so I have more choice to design the code.

Saturday, July 02, 2005

Got the answer about the cell editor

I have tried many ways to solve the cell editor with popup dialog problem. like: use mouse event listener , ListSelection listener,Focus Listener ,extend a AbstractCellEditor,etc. but these don't work. I post my question on the Sun forum. I got a similar sample.
Contrast to my prior work, I found I have use the syntax: myJTable.setCellEditor(new MyCellEditor()) and myJTable.setDefaultCellEditor(String.class,new MyCellEditor()).These two syntax don't work. The syntax in the sample use : myJTable.getColumnModel().getColumn(0).setCellEditor(new MyCellEditor). It does work!! But I still don't know what the difference between them.
Note: MyCellEditor is a CellEditor that I extends the AbstractCellEditor or DefaultCellEditor(Both work).

Friday, July 01, 2005

Can't find a good way to focus the cell of JTable

Today,I studied one technology, use Java to implement print.I found java's print function is not good,according to some articles.Though there are Java API can be used to implement the print function. and I tried to use cell of JTable to call the pictures or Text,but I failed. The thing is : If I click one cell,which stands for a dish name,I hope it will jump to a dialog or interface, on which pictures or texts will display. I got some idea from internet,but it seems not to be exact. I will try it tomorrow.

Wednesday, June 29, 2005

Database Synchronization problem

I have finished some GUI design of PC client, and built the connection to the MySql database. By the GUI, I can create,modify,and delete the table of the database. The table of MySql database is used to save the oder information. But there is one problem: I can't make the data of GUI table(JTable) synchronized with the data of table in the database.