quick JAVA question

headstrong

Expert Member
Joined
May 10, 2006
Messages
1,099
Reaction score
0
Hi guys

I am using java to connect to MS access..

How do I clear the output page? i tried c.clear(); but that did not work..

any suggestions?

Thanks
 
Hi,

Are you outputing to System.out console? If you are, there is no 'proper' way to clear the console. You can write a loop to do lots of println() but there is no way to know what the buffer size is so you wont know if you have cleared the entire screen.

If you are using the hsa console that comes with Ready to Program (I know many schools still use this) then c.clear() should work. But make sure you do are in fact using this console (I think there should be an import hsa.* at the top and that c is an hsa.Console.)

If you are doing this for yoru matric project, perhaps consider doing a GUI with Swing. You do get extra marks for doing that.

Good luck

Spinz
 
Hi Spinz.

We used to use hsa console but not anymore. I'm using the System.out console and i'm also doing my matric project using a GUI and have imported javax.swing.* etc.. I think that i must try and code the program to not use System.out.print then.. thanks

Do you know of any other good/fancy ideas to disply data from a database? I am currently using a scroll panel but want to make project look good....

Thanks
 
Last edited:
Hi,

The easiest way is to load your database results into an array or vector and then use that as an data source for a JList. Then when the user select an item in the list you can display the associated info next to the list. If you want, I have some resources for doing a matric computer studies project (for the western cape syllabus). I gave them to my students to help them get started (yes i teach the subject part-time). Actually, you arent one of my students are you? :P

Well, let me know if you need more help. I'm also online (google talk), supposedly waiting to help my students but guess they are all partying and waiting to the last possible minute to do anything.

Good luck

Spinz
 
Thanks Spindrift

I would really appreciate it if I could have a look at those resources. I have PM'd you with my email address.

I might be one of your students... :D... you never know

Thanks
 
Top
Sign up to the MyBroadband newsletter
X