25 May 2008 @ 11:21 PM 

Here’s a small demo I wrote that shows you how to use the Java JToolBar. The toolbar doesn’t do a lot except for showing a message when the user clicks one of the toolbar items.

Screenshot:

More »

Tags Tags: , , , ,
Categories: Java, Languages
Posted By: HappyFace
Last Edit: 15 Jun 2008 @ 03 01 PM

E-mailPermalinkComments (0)
 22 May 2008 @ 10:22 PM 

Someone asked me to write an application that:

• Use an array to store the data for the different brands.
• Must have 4 additional index positions available for data entry so that I may be able to add
• Must ensure that PR or Plain Wrap is not duplicated in data entry
• Cannot use scanner
• You may choose to use 2 dimensional array (one class needed) or object of array(two classes needed)

Output:
• You will need to display the plain wrap number chosen and the corresponding Brands for that particular part.

So here it is:

More »

Tags Tags: , , , , , , , , , , , , , ,
Categories: Java, Languages
Posted By: HappyFace
Last Edit: 25 May 2008 @ 11 31 PM

E-mailPermalinkComments (0)
 18 May 2008 @ 4:46 PM 

This is a demo I wrote earlier today to show you how you can write captcha software with Java. The application is really basic and currently only supports numbers but the code can be modified easily to support text. I’ll probably add this features later when i have the time to code it. Until then, here’s the JCaptcha code that works with numbers:

More »

Tags Tags: , , , , , , , ,
Categories: Java, Languages, uncategorized
Posted By: HappyFace
Last Edit: 25 May 2008 @ 11 34 PM

E-mailPermalinkComments (0)

Here's a demo I wrote to show an example of the usage of a timertask. This demo will show a "reminder" dialog after x seconds.

JAVA:
  1. public class TimerTaskDemoV2 extends JDialog  implements ActionListener {
  2. Timer timer;
  3. JTextArea info = new JTextArea("This is a reminder..\nBy: HappyFace\nwww.engineeringserver.com");
  4. public TimerTaskDemoV2(int seconds) {
  5. timer = new Timer();
  6. timer.schedule(new RemindTask(), seconds*1000);
  7. }
  8. public TimerTaskDemoV2(){
  9. getContentPane().setLayout(null);
  10. info.setEditable(false);
  11. info.setBounds(0,0,200,100);
  12. ok = new JButton("Close");
  13. ok.addActionListener(this);
  14. ok.setBounds(0,100,200,30);
  15. add(info);
  16. add(ok);
  17. setTitle("Reminder");
  18. setDefaultCloseOperation(0);
  19. setSize(207,155);
  20. setResizable(false);
  21. setLocationRelativeTo(null);
  22. setVisible(true);
  23. }
  24. class RemindTask extends TimerTask {
  25. public void run() {
  26. TimerTaskDemoV2 tmp = new  TimerTaskDemoV2();
  27. timer.cancel();
  28. }
  29. }
  30. public void actionPerformed(ActionEvent e) {
  31. if(e.getSource() == ok){
  32. System.exit(0);
  33. }
  34. }
  35. public static void main(String args[]) {
  36. int wait = 5;
  37. System.out.println("Wait "+ wait + " second(s)");
  38. new TimerTaskDemoV2(wait);
  39. }
  40. }

Tags Tags: , , , , , ,
Categories: Java
Posted By: HappyFace
Last Edit: 24 Aug 2008 @ 06 30 PM

E-mailPermalinkComments (2)
\/ More Options ...
Change Theme...
  • Role »
  • Posts »
  • Comments »
Change Theme...
  • VoidVoid (Default)
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLightweight