Total members 11895 |It is currently Sat Dec 21, 2024 7:24 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





instantiating java classes

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




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 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 .

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

For this message the author DrRakha has received gratitude : ruthie

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


Author:
Newbie
User avatar Posts: 39
Have thanks: 15 time

For this message the author isuru has received gratitude : DrRakha
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : instantiating java classes
 Wrapper classes use in java     -  
 java wrapper classes     -  
 Nested classes(inner class) in java     -  
 java.util classes and interfaces support event handling     -  
 about classes     -  
 How to create and use classes in C++     -  
 Abstract Classes in jsp     -  
 how do i create the classes XX and YY?     -  
 inherited in the derived classes     -  
 Add and Remove CSS classes to html tag dynamically     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com