Pages

Tuesday, November 10, 2015

Which language to chose for programming (java or c++) ?

Which language to chose for programming (java or c++) ?



One of the most basic things to learn is programming ..if you became a programmer.than there will be no language..you can problem with.One of my teacher said...when i got programming concept..i even didn't knew how to make a website with php..I gave only one week to make a website and i did it very well,Because i got programming concept.
so for a good programmer the key is to learn programming ...languages aren't that important.Because all the language have the same concept but a little different in syntax and keys thats all.




which language should i learn ......java or c++




But here comes another question.Shoud i start programming with java or c++.
I was conpused completely which way to start programming , i was always thinking about shoud i learn java or c++,i really didn't know that time. What is programming? which languge has more importants?


So i finally found..to go with c++. Because one of the big company microsoft is using c++ ,in airport,online banking and in hospitals the use of c++ is pretty generall..And actually this wasn't the reason for me to choose c++.The reason was a little bit diffrent.sure you would laugh....


.Alright so when i grew up to intermediat level classes in Pakistan..there is use just only one language..which is c++..thats why i choosed to c++.And as well as i am suggesting to you to choose c++,and let me tell you some thing more interesting if you will learn c++.you will be defenetly the master of java as well.




So that's all about this question ..




now if you are interested to learn c++..i have many online tutorials on dailymotion ,youtube ,blogspot,wordpress and right here in this website as well go and get them or just simply watch them online..
The links have mentoined in this site on the left side, top , colom..


One thing more i am not saying that you should not use java.because i personaly started programming with java. if you are interested to learn java i have lots of tutorials about java in blogspot,wordpress,youtube and dailymotion,you can watch and read online.



If right now if you have any problem about java programming just contact me throw i have given the contact form in each of my page.So just click on that and leave me a comment or just message me and trust me.i'd love help you out from every difficulties you have..



Contact me throw facebook click on the facebook icon below

Books for Mcs 1st semester pakistan (awkum abdul wali khan university)

Assalam-o-alaikum(warahmat-ullahi-wabarakatuhu)

Books for Mcs 1st semester pakistan (awkum abdul wali khan university)


Explanation



I am the student of computer Science and i am new to the 1st semseter. I recently admited at abdul wali khan university(awkum).So today was my first day at university and all my university fellows and dear friends were looking for which books are rocommended to us for this semester.

So i went to the notice board there was a books list haging on the notice board so i took a photo from that.And as i came home so i thought why shoudn't i share this books list with my abdul wali khan university or any pakistani mates to get help them out from this unwanted situation..Yeah there you go..the list of the books for the Mcs(master) abdul wali khan university Computer Science first semister is given below





        AWKUM Masters (MCS) Semester   NO 1

no        cource name

1 Oops-MCS-111 2 introduction to ICT-MCS-112 3 DLD-MCS-113 4 DATA COMUNICATION-MCS-114 5 TBW-MCS-115 ENGLISH 6 WEB-MCS-116

Monday, November 9, 2015

how to add an action to a button in java

Source code for the button actionListener




myClass= code below





package myPackage;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class myClass extends JFrame {
   
  /*create JPanel*/
   JPanel panel = new JPanel();
   
   /*create JButton here*/ 
 JButton button =new JButton("Click me");


 public myClass(){
   setSize(400,600);
   setDefaultCloseOperation
   (JFrame.EXIT_ON_CLOSE);
     setVisible(true);
   setTitle("simple Button");
   add(panel);
   button.setPreferredSize(new Dimension(100,50));
   panel.add(button);

   /*add Action Listener*/
   button.addActionListener(new ActionListener(){
   
public void actionPerformed(ActionEvent e) {
  /*asign source in an object*/           

  Object source = e.getSource();
   /*add action*/
  if(source==button){
            
 /*print text to the console*/
System.out.println("i am clicked");

  }  
  }
       
       
   });

 } 
 
   
}






myMain = main class source code below

 package myPackage;

  public class  myMain  {
     
     
         public static void main(String[]args){
           myClass cl= new myClass();


         }
    }





Sunday, November 8, 2015

how to create JRadiobuttons in java with whole set up java beginner

Assalam-o-alaikum warahmat-ullahi-wabarakaatuhu.

      

                                           HOW TO CREATE JRADIOBUTTONS WITH WHOLE SITTING
                        IN JAVA 




package myPackage;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

public class myClass extends JFrame implements ActionListener{

/*create JPanel*/
JPanel panel = new JPanel();

/*create RadioButton here*/

 JRadioButton button =new JRadioButton("apple");
 JRadioButton button1 =new JRadioButton("banana");
 JRadioButton button2 =new JRadioButton("guava");
 JRadioButton button3 =new JRadioButton("mangoes");

 public myClass(){
  setSize(400,600);
setDefaultCloseOperation
(JFrame.EXIT_ON_CLOSE);
     setVisible(true);
setTitle("Radio Button");
add(panel);
radioButton();

 }
    

public void radioButton(){

/*add all buttons to
* the panel
*/
panel.add(button);
panel.add(button1);
panel.add(button2);
panel.add(button3);

/*select them false*/
button.setSelected(false);
button1.setSelected(false);
button2.setSelected(false);
button3.setSelected(false);

/*now add actionListener*/
button.addActionListener(this);
button1.addActionListener(this);
button2.addActionListener(this);
button3.addActionListener(this);


 
}
   
/*method for to add actionPerformed*/

public void actionPerformed(ActionEvent e) {
     Object source = e.getSource();
   
     /*actionListener for button*/
   
 if(source==button ){
 
button.setSelected(true);
button1.setSelected(false);
button2.setSelected(false);
button3.setSelected(false);

/*only button to be true*/
 }

 /*actionListener for button1 */
      
 if(source==button1 ){
 
button.setSelected(false);
button1.setSelected(true);
button2.setSelected(false);
button3.setSelected(false);

/*only button1 to be true*/
}



 /*actionListener for button2*/

if(source==button2){
   
button.setSelected(false);
button1.setSelected(false);
button2.setSelected(true);
button3.setSelected(false);

/*only button2 to be true*/
}


/*actionListener for button3*/

if(source==button3){
   
button.setSelected(false);
button1.setSelected(false);
button2.setSelected(false);
button3.setSelected(true);

/*only button3 to be true*/
}
}
}




and if you run this so it would look like




Thursday, November 5, 2015

how to create a label....add text to label

Assalam-o-alaikum

           

           add Text to the JLabel


 Today i am gonna be showing you.how to add text in java frame / panel pretty simple ...below is the source code copy them and paste it to eclips...play with it by yourself ..And you will clear i am sure

IN these code this is a whole process and in this we'll do all stuff to be excutable


package myPackage;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;


public class myClass {
  
public static void main(String[]args){
JFrame frame = new JFrame();
JPanel panel = new JPanel();
/*create object first */
JLabel label = new JLabel();
frame.setSize(400,600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setTitle("JLabel");
frame.add(panel);
/*add the label into the
* panel*/
panel.add(label);
/*set label text*/
label.setText("who are you?");
/*set background 
* of label*/
label.setBackground(Color.red);
}
}

and no if you run this so it would look like




method for the jlabel is below



 public void label(){
 
 
 JLabel label = new JLabel();
 
 label.setText("this is a label");
 
 label.setBackground(Color.blue);

 panel.add(label);

 }
cxcafdd


YOu can also create some cool looking border..Source code below


 
 public void smartLabel(){
/*create a label*/
JLabel label = new JLabel();
 
  /*set text of label*/
label.setText("this is a label");
  
  /*set border of 
    label */
Border border =
BorderFactory.createLineBorder(Color.red,2);
label.setBorder(border);

/*setBackground of label*/
label.setBackground(Color.WHITE);

/*set Size of label*/
label.setPreferredSize(new Dimension(44,10));
 }
 
}
 


Wednesday, November 4, 2015

how to create a jpanel in java

  Assalam-o-alaikum (warahmatullahi.wabarakatuhuu)               
  
                                  JPanel in Java

adding panel in the main function


package myPackage;

import javax.swing.JFrame;


/*JPanle import below
 make sure to import 
 */
import javax.swing.JPanel;


public class myClass{

 public static void main(String[]args){

 JFrame frame = new JFrame();


 /*create a JPanel object Here*/


JPanel panel = new JPanel();

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setTitle("create Jpanel");

frame.setVisible(true);

frame.setSize(450, 500);


panel.add(frame);

}

}
and if you run so it would look like







adding panel in a separate classes in a method

this is the main class



package myPackage;

public class myMain {
 public void main(String[]args){
myClass clas = new myClass();
 }
}



now this is the class for methods to add JPanel into a frame



package myPackage;

import java.awt.Color;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class myClass {

/*create a Jframe here*/

JFrame frame = new JFrame();

/*create a JPanel here*/

JPanel panel = new JPanel();

public myClass() {
frame();
}
public void frame(){
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setTitle("create Jpanel");

frame.setVisible(true);

frame.setSize(450, 500);
/*join both together
* cause we are call 
* this mehtod in
* the constructer
* so call the panel
*  method
*/
panel();
}
public void panel(){
 
panel.setBackground(Color.black);
frame.add(panel);

}

}



and the same result



Tuesday, November 3, 2015

how to create JFrame in java

Assalam-o-alaikum

              Create JFrame in java



package framecreate;


 import javax.swing.JFrame;


public class myClass {



public static void main(String[]args){


JFrame frame = new JFrame();
 
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setVisible(true);

frame.setSize(400, 300);

   frame.setTitle("this is JFrame");




}


}

Monday, November 2, 2015

Zong to Zong free call 03/11/205

Zong to Zong free call

                                        03/11/2015


zong laya 10 to 20 free minuts zong se zong network per call karne k liye .....to bagheer kise subscription ya
balance k zong se call karein latadad .aur o be bilkul free...

faydein  

1....koi charge nahe 

2... koi balance hona zarori nahe 

3... koi subscription zarori nahe 

4...sirf zong se zong network per 

5...her din 24 hour k liye.. 
6..her din sirf 10 se 20 minut k liye baat karsakte ho.

now zong has bring to you alot of free minuts for whole day without any chargs without any subscription....so don't wait and call to every zong network for free 
24 hour servise no balance and no suscription required..

 advantage 

1..no charge 
2..no balance is required  
3..no need to subscribe 
4..and you can call to every zong costumer 
5..Availibality for 24 hours a day...
6..you can just 10 to 20 minuts a day...

Array of JButton

Assalam-o-alaikum


                                        
                Array of JButton



package myPackage;

import javax.swing.JButton;



public class myClass{



public void buttonArray( ){


JButton[] button=new JButton[3];

button[0].setName("button1");
button[1].setName("button2");
button[2].setName("button3");


panel.add(button);

}

}

Sunday, November 1, 2015

  Assalm-o-Alaikum

         JButton create in java Source Code


package myPackage;

import javax.swing.JButton;

public class myClass{


public void button(){

JButton button = new JButton("button");
button.add(panel);

}

}