How to call my customerized class ?

S

saysay234

Hi,there,

I am the fresh developer in Java language and now face a problem
below.Can anybody give me a answer please?

I make a new class myShowChart.class,which is inheritated from Jframe
and want to call it from my main body in myMain.java. How could i
indicate that i will invoke myShowChart.class?
should i use 'import', or 'package' command in main body, or other
command?
It might be stupid question as i have no any experience of java untill
last week.

looking forward to learn from you guys

howard.
 
J

Joona I Palaste

saysay234 said:
Hi,there,
I am the fresh developer in Java language and now face a problem
below.Can anybody give me a answer please?
I make a new class myShowChart.class,which is inheritated from Jframe
and want to call it from my main body in myMain.java. How could i
indicate that i will invoke myShowChart.class?
should i use 'import', or 'package' command in main body, or other
command?
It might be stupid question as i have no any experience of java untill
last week.
looking forward to learn from you guys

If it's in the same package as myMain, then just refer to it as
"myShowChart" with no fancy commands needed. Otherwise, you need to
import the package it's in.
If you don't know about packages yet, then you don't need to do
anything. Although using the nameless default package is very fast
becoming deprecated in Java, it still works, and can be useful for
trivial test or learning programs.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"The day Microsoft makes something that doesn't suck is probably the day they
start making vacuum cleaners."
- Ernst Jan Plugge
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top