10 Sep 2008 @ 11:38 PM 

I got a request from someone that asked me to create an applet that can be used as a quiz, well since I had a bit of time today I went ahead and coded it for him. The questions will be randomized every time you run the applet but as of now I’ve only made 5 questions so the application picks the first 5 questions available. I’ll see if I can upload a demo somewhere to show you how it works but the applet needs a java.policy file that doesn’t run in a browser so i’ll see if i can manage to create a self signed java applet.

/* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
/* DO NOT EDIT */

grant {
permission java.security.AllPermission;
};

Screenshot(s):


What do you think about it? Comments/suggestions are welcome!
More »

Tags Tags: , , , , , , , , , , , , , , , ,
Categories: Java
Posted By: HappyFace
Last Edit: 18 Nov 2008 @ 04 22 AM

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