Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 8:47 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 3 posts ] 
Author Question
 Question subject: instantiating classes
PostPosted: Fri Nov 12, 2010 6:22 am 
Offline
Newbie
User avatar

Joined: Fri Nov 12, 2010 6:13 am
Posts: 1
Has thanked: 1 time
Have thanks: 0 time

How do i instantiate a class in my gui code? For example i have a pay class that will be used in my gui code, how do i implement it?

Thanks


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: instantiating classes
PostPosted: Fri Nov 12, 2010 10:23 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
all datatypes in java are classes and can be up casted to root class OBJECT .You can extend GUI classes ( like JFrame ,JPanel , JButton ) lets say MyFrame (Which extends JFrame) and use an object instance from your class inside it .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )



For this message the author msi_333 has received gratitude : ruthie
TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: instantiating classes
PostPosted: Thu Nov 18, 2010 12:09 pm 
Offline
Newbie
User avatar

Joined: Thu Nov 18, 2010 11:56 am
Posts: 49
Has thanked: 0 time
Have thanks: 15 time
When a number of objects are created from the same class blueprint, they each have their own distinct copies of instance variables. In the case of the Bicycle class, the instance variables are cadence, gear, and speed. Each Bicycle object has its own values for these variables, stored in different memory locations.

Use of the static keyword to create fields and methods that belong to the class, rather than to an instance of the class.

You can extend JFrame by,

public class MyFrame extends JFrame {
//Your code
}

_________________
Coding my life with Java, PHP, JavaScript, and Python



For this message the author isuru has received gratitude : msi_333
TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 3 posts ] 
Quick reply


  

 Similar topics
 how do i create the classes XX and YY?
 Boxing and unboxing make using wrapper classes
 Nested classes(inner class) in java
 Abstract Classes in jsp
 The three major concepts of C++ - Part 1: Classes
 java wrapper classes
 java.util classes and interfaces support event handling
 Wrapper classes use in java

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: Google Adsense [Bot] and 2 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team