Tuesday, 22 March 2016
Tuesday, 15 March 2016
Friday, 11 March 2016
Connecting java project, JDBC driver and MySQL all together
Found a nice video tutorial. A really nice tutorial without bullish*t :D on Utube: https://www.youtube.com/watch?v=2i4t-SL1VsU
Thursday, 10 March 2016
MySql database
Ok. Installed a MySql database on Mac with Homebrew. Now I need to read how to use it and create tables and such.
Tutorial: http://dev.mysql.com/doc/refman/5.7/en/tutorial.html
Tutorial 2: http://www.tutorialspoint.com/mysql/
Tutorial: http://dev.mysql.com/doc/refman/5.7/en/tutorial.html
Tutorial 2: http://www.tutorialspoint.com/mysql/
Invoice Preview
Ok. Here is an idea: to preview invoice as html and then if user presses the button download (export), it will be saved as pdf. The only question is how to make it work :D
Here is a link which might be helpful: http://pdfcrowd.com/web-html-to-pdf-java/ . Also here is an example ... haven't figure out it yet: https://docs.oracle.com/javase/tutorial/uiswing/components/text.html , and here too : https://docs.oracle.com/javase/tutorial/uiswing/components/html.html .
Here is a link which might be helpful: http://pdfcrowd.com/web-html-to-pdf-java/ . Also here is an example ... haven't figure out it yet: https://docs.oracle.com/javase/tutorial/uiswing/components/text.html , and here too : https://docs.oracle.com/javase/tutorial/uiswing/components/html.html .
Friday, 4 March 2016
Java tutorials
1. http://www.tutorialspoint.com/java/index.htm
2. http://learnjavaonline.org/en/Welcome
3. Event listeners - http://docs.oracle.com/javase/tutorial/uiswing/events/index.html
4. Designing a Swing GUI in NetBeans IDE - https://netbeans.org/kb/docs/java/quickstart-gui.html
! 5. The Java™ Tutorials - http://docs.oracle.com/javase/tutorial/index.html
6. LearnITGirl - https://www.learnitgirl.com/learning_materials/java
basic sources: Oracle, NetBeans
2. http://learnjavaonline.org/en/Welcome
3. Event listeners - http://docs.oracle.com/javase/tutorial/uiswing/events/index.html
4. Designing a Swing GUI in NetBeans IDE - https://netbeans.org/kb/docs/java/quickstart-gui.html
! 5. The Java™ Tutorials - http://docs.oracle.com/javase/tutorial/index.html
6. LearnITGirl - https://www.learnitgirl.com/learning_materials/java
basic sources: Oracle, NetBeans
OOP
Method Overloading:
When a class has two or more methods by same name but different parameters, it is known as method overloading.
In overriding a method has same method name, type, number of parameters etc.
Lets consider the example shown before for finding minimum numbers of integer type. If, lets say we want to find minimum number of double type. Then the concept of Overloading will be introduced to create two or more methods with the same name but different parameters. (taken from link)
The Constructors:
A constructor initializes an object when it is created. It has the same name as its class and is syntactically similar to a method. However, constructors have no explicit return type.
Typically, you will use a constructor to give initial values to the instance variables defined by the class, or to perform any other startup procedures required to create a fully formed object.
All classes have constructors, whether you define one or not, because Java automatically provides a default constructor that initializes all member variables to zero. However, once you define your own constructor, the default constructor is no longer used. (taken from link)
The this keyword
this is a keyword in Java which is used as a reference to the object of the current class, with in an instance method or a constructor. Using this you can refer the members of a class such as constructors, variables and methods.
In general the keyword this is used to :
- Differentiate the instance variables from local variables if they have same names, within a constructor or a method. (taken from link)
Call one type of constructor( parametrized constructor or default ) from other in a class. It is known as explicit constructor invocation.
class Student{ int age Student(){ this(20); // invoking the default constructor } Student(int age){ this.age=age; } }
public class This_Example { //Instance variable num int num=10; This_Example(){ System.out.println("This is an example program on keyword this "); } This_Example(int num){ //Invoking the default constructor this(); //Assigning the local variable num to the instance variable num this.num=num; }
Variable Arguments(var-args):
JDK 1.5 enables you to pass a variable number of arguments of the same type to a method. The parameter in the method is declared as follows:
typeName... parameterName
In the method declaration, you specify the type followed by an ellipsis (...) Only one variable-length parameter may be specified in a method, and this parameter must be the last parameter. Any regular parameters must precede it. (taken from link)
The finalize( ) Method:
It is possible to define a method that will be called just before an object's final destruction by the garbage collector. This method is called finalize( ), and it can be used to ensure that an object terminates cleanly.
protected void finalize( ) { // finalization code here }
(taken from link)
Tuesday, 1 March 2016
Swing for Java and tables creation
Yesterday I came across with a small problem while creating GUI for my toy-application... I wanted to create a drop-down list in a table but it seems it's not that straight-forward as I was hoping.. Here is a link with a possible solution: http://stackoverflow.com/questions/11684903/how-to-add-a-drop-down-menu-to-a-jtable-cell
Friday, 26 February 2016
My first Swing app in Java
Ok. So, my mentor gave me a task to create a Button with the label "Hello Nelly!".
I found a Swing tutorial to get started with it. Here it is. Gonna follow it and see how it goes. Lets start ...
I found a Swing tutorial to get started with it. Here it is. Gonna follow it and see how it goes. Lets start ...
Subscribe to:
Posts (Atom)