Thursday, January 30, 2014

How to remove the border of a JFrame

Assuming that you 're developing an application, in which the default look-and-feel doesn't match, at all.

To be more specific, imagine the following example: I sometime wanted to develop a real-time clock JAVA application. It would be a bit ugly for the application's purpose to have the annoying border around its JFrame.

Indeed, there is a way to implement this: you just need to set the frame's undecorated method to true:   frame.setUndecorated(true);

Keep in mind that the above code has to be placed before frame's setVisible() method. Otherwise, it's like initializing the frame and then telling it to be undecorated, sth that doesn't make sense. So, you first customise the frame as you wish (undecorization, etc) and then you enable its visibility.

The full application that supports this post is related here.

Wednesday, January 29, 2014

How to solve LF would be replaced by CRLF git

It's nearly to seven in the morning (new english expressions) and before going to bed, I would like to share this experience, as the most stuff that I found over the net wasn't very impressive to my tired eyes.

I today started dealing with github and git, although there have been months since I first created an account. 
So, sometime, while trying to upload some files to a public repository of mine, I got the quoted message, displayed in the title.

I tried to find a quick solution to stackoverflow, refering to the first hits of google, here and here, but while being in a rush, my eyes caught words like unix, etc., so I tried to found out by myself what was going on, because the exact error message, did also included the filename that was causing the error.

EDIT: Before continuing reading this, be sure that you tried the following command in the git shell:

git config core.autocrlf false

Opening the file was like a dream:

  1. What I quickly understood in the fore-mentioned links, was what I exactly seeing in my file.
  2. The little knowledge that I accomplished to acquire through this quick reading, made a light flash in my mind.
The exact image was sth like this : 
So, I just had to hit my Backspace button
and everything got as default; successful push
to github accomplished!
If the above wasn't enough and you countinue getting errors, try to open the specified file with Notepad++, go to Edit => EOL Converion => Windows Format.

Dunno if this really helped you or it made your situation more difficult, but I thought about sharing it, 'cause newbies like me in github may find it useful.

How to configure Primefaces 5.1 and JSF 2.2 in Eclipse IDE

Hi there!

Today I will show you how to configure Primefaces 4.0 with JSF 2.2 in the Eclipse Kepler IDE (v4.3).

If you don't have any idea of what we 're talking about or it's the first time that you 're facing J2EE, you may find interesting my first two articles about JSF 2.0 and Eclipse integration, in JCG community :
  1. JSF 2.0 Eclipse IDE Support
  2. Hello World Example with JSF 2.0
Now that you 're enough experienced, let's link Primefaces with JSF and Eclipse, too. There are two main actions that we need to no, in order to implement this:

We first need to add the following dependency, in the pom.xml file:

<dependency>
   <groupId>org.primefaces</groupId>
   <artifactId>primefaces</artifactId>
   <version>5.1</version>
</dependency>

We 're pretty ready! Naaah, don't be in a rush. As you might found out by yourself, Primefaces deals with the visual components of our websites, so obviously, the xhtml reference that we provided (in the fore-mentioned links/articles) isn't enough; we need to add two more references, in order to get the Primefaces up and running:

<html xmlns="http://www.w3.org/1999/xhtml"    
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui" >

That was it. You 're ready to start developing your awesome look-and-feel web applications with JSF and Primefaces.

I also created a simple gist for the purpose of this configuration. 


Cheers!

Tuesday, January 28, 2014

That's my very first post, so...Hello World!

I won't introduce myself in detail, as you 'll find out many information about me in my social netoworking profiles; the only thing that I would like to express as a first feeling is to just excuse me about whatever you may not like and is related to the current blog's layout and "look & feel" - I'm a newbie blogger, so be patient about it, please!

I just want to mention, that the purpose of this blog is mostly to share programming and software related information that I find interesting (and to get feedback, of course) ; something tha cannot be done through social networking (except GitHub).

To sum up, my second post will be related to Primefaces 4.0 + JSF 2.2 configuration in Eclipse Kepler (v4.3).

So, stay tuned!