home

Text Encrypter

Here is what I've been developing the last few weeks:
Text Encrypter is a free tool that allows you to create and encode text. The purpose is to be able to protect sensitive data as passwords or over profile information. Feel free to protect any data you want.

The encryption uses the AES algorithm and the key is encoded in Sha-1 before being used.

Download

This program is at an early stage and may not be stable, but you can still download it here: TextEncrypter.0.1.zip

About

This program has been developed in Java and uses the icons available at famfamfam.com . To run it you must have version 1.6 of Java or higher.

Some of the code

While developing this app I made some interesting classes you may want to use in your own projects. One of them is a custom TextField class that allows me to have a placeholder. Simple and small, there it is:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.RenderingHints;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.Graphics2D;
 
import javax.swing.JTextField;
 
public class JTextFieldPlaceHolder extends JTextField{
    private String placeHolder;
     
    private Color textColor = Color.BLACK;
    private Color placeHolderColor = Color.GRAY;
     
    JTextFieldPlaceHolder(){
        this("", "");
    }
     
    JTextFieldPlaceHolder(String placeHolderInit){
        this(placeHolderInit, "");
    }
     
    JTextFieldPlaceHolder(String placeHolderInit, String value){
        super(value);
         
        this.setMargin(new Insets(0,5,0,5));            // We set the margin so the text doesn't stick to the textField
        this.setMinimumSize(new Dimension(70, 35));     // We set a minimum size so that the textField doesn't end up crushed in small containers
         
        placeHolder = placeHolderInit;                  // We set the placeHolder variable
         
        this.setForeground(textColor);                  // We finally set the color of the text
    }
     
    // We override the paint method to draw the placeHolder when needed
    public void paint(Graphics g)
    {
        super.paint(g);
         
        // if the textField is empty
        if(this.getText().equals("")){
            Graphics2D g2d = (Graphics2D)g;             // Cast g into Graphics2D to be able to draw smooth text
            g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON );
            g2d.setFont(this.getFont());                // Set the font into the textField font
            g2d.setColor(placeHolderColor);             // Set the font color, then draw the text
            g2d.drawString(placeHolder, 7, (this.getHeight()/2)+(this.getFont().getSize()/2)-1);
        }
    }
     
    public String getPlaceHolder(){
        return this.placeHolder;
    }
     
    public void setPlaceHolder(String newPlaceHolder){
        this.placeHolder = newPlaceHolder;
    }
     
    public Color getPlaceHolderColor(){
        return this.placeHolderColor;
    }
     
    public void setPlaceHolderColor(Color newPlaceHolderColor){
        this.placeHolderColor = newPlaceHolderColor;
    }
}
Here’s an example:
JTextField myinput = new JTextFieldPlaceHolder("PlaceHolder","InitialValue");
JTextField myinput2 = new JTextFieldPlaceHolder("PlaceHolder");
JTextField myinput3 = new JTextFieldPlaceHolder();
More source code will be available soon.

Hello Again

Finally a stable version of the website running with the portfolio working. Also, the administration is complete enough to create, upload and edit everything. I've deleted the sidebar, maximized the size for the content and increased the size of the text. The titles are now written with a custom font, thank you Google fonts. Furthermore this website is now scalable and adapted for small and large screen with a CSS adapter.

Just to say this website is now ready for some content! So please come again.
12