Engineeringserver.com

A community for computer science students & developers about software development, game development, game design, games, anime preview & reviews and more!

Archive for March, 2008


Okkusenman

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
359 views

I came across this just a few hours ago and although it sounds like megaman the name is different. This video is freaking superb! A must watch for megaman fans =) !

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

lolcats @ icanhascheezburger

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
3,413 views

So, today I happened to search for some funny images and I saw a few lolcats images that were like “omg i’m going to cry from too much laughing” , these images are taken from icanhascheezburger. If you like cats im sure you will find it somewhat funny ;)
Anyway, I’ll regulary blog and post new lolcats images because I like them and cats are cute!

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Going to sleep

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...
268 views

A programmer started to cuss
Because getting to sleep was a fuss
As he lay there in bed
Looping ’round in his head
was: while(!asleep()) sheep++;

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Wanna boom boom in my room?

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
326 views

Ask these guys.

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Adolf Ballmer

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
236 views

I got this link from someone that thought it was funny and I was like wtf, see and judge it yourself.

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Placing components in a JFrame container without using a layoutmanager

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.5 out of 5)
Loading ... Loading ...
391 views

Instead of making use of a layout manager such as borderLayout, flowLayout, gridLayout etc I use an absolute layout to place the component into my container with the coordinate that I specify. The downside is that it requires a lot of testing because you need to make sure that the component you place are in the right position. The other “downside” is that the position of the components never change even when you are resizing the JFrame, JDialog etc.. it is possible to resize the components when resizing the container but that will be discussed another time.

Anyway, this is how to create an absolute layout in Swing:

First set the layout to null so you don’t use any layout managers.
setLayout(null);

After that, create an component that you want to be placed on your container.
input1 = new JTextField();
input1.setBounds(0,0, 99,20);

Add the component:
getContentPane().add(input1);

And finally, set the size of the container etc
setSize(210,120);
setLocationRelativeTo(null);
setVisible(true);

Yes there are better ways to do this but for me this is the easiest way to do it using absolute positioning. If you have a suggestion or a tip about creating a layout with Swing/AWT im happy to hear about it.

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Over 100.000 people visited our blog since 2007, and close to 700.000 hits!

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
213 views

Today I looked at the statistics of my blog and I noticed that there were over 100.000 uniques that visited this blog since January 2007.

With almost 700.000 hits since January 2007 im sure it’s only a matter of months before we hit the 1.000.000 mark. We are growing fast and we recieve more (returning) visitors every day that enjoy reading the blog.

Awesome! We couldnt do it without your support.
Glad you like the blog! :)

Screenshot:

As you can see almost 1000 people visited the site yesterday looking at ~2.5 pages on average.

Regards,

HappyFace
www.engineeringserver.com

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

What the hell happened here???

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
183 views

Uhm.. nice parking people.

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Javascript and regular expressions

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
331 views

I needed to write a few javascript functions for a class called (3WEBD1 Web Development 1 TCIE-V3WEBD1B-07) , it's an assignment that I had to do last week but because of the deadline of another ( rather important ) project I skipped it but i'm planning to finish this assignment today/tomorrow.

Anyway, I admit that i'm not very good (you can leave out the "very" ;p ) at javascript so I struggled a bit to find out how to write a regular expression function that would show an message when the postcode is invalid.

After some tests and searching on the net I came up with this:

JavaScript:
  1. function controleerPostcode() {
  2. match= new RegExp(/^[1-9]{1}[0-9]{3} ?[A-Z]{2}$/);
  3. if(document.formulier.postcode.value.length == 0) {
  4. return "- field empty\n";
  5. }
  6. if (!document.formulier.postcode.value.match(match)){
  7. alert("invalid postcode format! -> example: 1234 AB");
  8. }
  9. return "";
  10. }<

Call the function by adding this line in your html file:
<Button type="button" name="C" onClick="controleerPostcode();">testButton</Button>

Good for me that the regular expression function works. Now I need to finish the rest of the assignment but that should not be as hard as this ;)

I hope this helped if you are struggling with Javascript and regular expressions!

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here

Set a custom image in the title of your JFrame

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...
260 views

Here is an example how to add a custom image in the top left of your JFrame.

Declare a global variable like this:
static String userDir = System.getProperty("user.dir");

And in the constructor where you make the Gui add this code:

JAVA:
  1. Image icon = Toolkit.getDefaultToolkit().getImage(userDir + "/yourImage.png");
  2. setIconImage(icon);

Make sure you have the image in the root of your folder.

Screenshot:

Bookmark this page: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • De.lirio.us
  • Slashdot
  • StumbleUpon
  • Technorati
  • Reddit
  • Digg

Your Ad Here