Help. javac keeps making more than 1 class with a $2 at the end.
I'm taking my first Java class and I'm supposed to submit 1 class per assignment for my 2nd assignment, javac is making practiceB$2 and practiceB$3.
here is the entire code
import javax.swing.*;
import java.awt.event.*;
public class practiceB {
JLabel label1;
int i=1;
public practiceB() {
// Create a window.
JFrame form1 = new JFrame("Main window");
form1.setSize(300,120);
form1.setVisible(true);
JPanel panel1 = new JPanel();
panel1.setLayout(null);
form1.getContentPane().add(panel1);
label1 = new JLabel("0");
label1.setBounds(10,10,100,20);
panel1.add(label1);
// Create a button and add it to the form1.
JButton button = new JButton("Click me");
button.setBounds(80,50,150,25);
panel1.add(button);
// Add an event handler for button clicks.
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
label1.setText(e.getActionCommand() + " " + i);
i++;
// Make the form1 closable.
form1.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public static void main(String[] args) {
new practiceB();
Even if I cut and paste the sample code I still get the same error
Edited by: 806143 on Oct 28, 2010 4:47 PM
806143 wrote:
Sorry, I figured there might be something wrong. We have to do 5 "labs" per assignment practice A through E then submit the classes A through E.
Submittal
1. Upon complete all the learning activities, create a zip file named lab2.zip with only the following files in it.
practiceA.class
practiceB.class
practiceC.class
practiceD.class
practiceE.class
2. Upload the zipped file to Assignment 02 through Blackboard.
That's why I was bit confused.I'll bet that since your putting all your *.class* files in a zip folder, it would probably mean these are the files which contain the<tt> main() </tt>method, and that there will probably be more files therein. Just as long as professor can launch your app with these files, I'm sure you're good to go OP.
Similar Messages
-
Packages with more than 1 class?
Does anybody know of a good tutorial on how to deal with packages, external classes?
I almost have it, ( I think) but whenever I try to use a package with more than one class in it -- even the standard ones supplied in the ActionScript references, they don't work. And, if I have anything in the flash file other than an empty single frame, it breaks. So this precludes the use of library objects, which, if you CAN use them, saves a lot of coding time....
Any ideas would be appreciated.
:<)Here is a package from the help files that I tried to implement in Flash 10. / AS3
It has more than 1 class. I couldn't get it to run. If you can show me how to get it to appear, I'll be a happy camper.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/accessi bility/AccessibilityProperties.html
:<) -
More than one class in single java source file?
Is there a way to define more than one class in single java source file?
I get a duplicate class definition error for each extra class, but I am sure there is a way to handle this in JDeveloper.
Anyone knows how ?Please post the question in jdeveloper forum at
JDeveloper and ADF
for quick response.
Regards,
Anupama
http://otn.oracle.com/sample_code/content.html -
Can we query more than one class in a call to .tmib
Hi,
i am creating a utility to monitor the applications at run time using mib.any
body have an idea if we can query more than one class in one call to .tmib.
thanks
roopeshThat would be an interesting enhancement, perhaps using Embedded FML to
pack multiple MIB requests into one buffer.
Product Management makes all decisions about major enhancements, and it
is based on customer need, so that's where the requests should go.
Scott Orshan
roopesh wrote:
>
yes.
i am trying to devlop a utility which can monitor
applications at runtime.i wanted to make as less the
no of calls to tmib as possible but one class does
not give all the information so i need to query
more than one.
anyways thanks for the reply.
"MS" <[email protected]> wrote:
Hi,
Are you trying to write a Tuxedo app health-check monitor utility.
A tuxedo client can make different calls to .TMIB service for different
classes.
I don't think we can query more than one class in a single call.
Are you looking for something else??/
HTH
regards
MS -
Hello. I have an iPad2, and iMovie software. My main problem, for the moment, is the length of the videos: I can´t create a video with more than 56 seconds. When I try, the app shuts off... Can anyone help me?
Sorry. We can't help you. It's no longer an iPhone. Apple won't touch it.
Take it to whoever replaced the screen and see if they can help you.
iPhones are not user servicable and Apple does not sell iPhone parts at all. I'd be surprised if you were actually able to back it up at this point. It sounds like it's completely borked. -
i want to ask that if my applet have more than one class, are all classes loaded to client machine autometically or i have to do it by another way (if yes how) ?
Put all the stuff into a single zip or preferably a single jar.
-
How can I make more than one account with chat on clubwpt?
I can't make more than one account with chat on clubwpt? i know several players that has made as many as 20 accounts with chat.I can make accounts but clubwpt will not give me chat,they must have my IP address ,because their response is " you r allowed one account with chat only." But as I have said several players have several accounts with chat. Can anyone help me? Are there any programs or plugins that can do this?Any help at all will be greatly appreciate.
Open another iCloud account for the other user.
-
HT1420 Can you have more than one device with a different Apple ID authourized to the same computer
Can you have more than one device with a different Apple ID authourized to the same computer
I think you are using the same Composition Class on both project. On the properties tab, you can change this number (e.g.: EDGE-1637270).
-
WebLogic Error : Registered more than one instance with the same objectName
HI there, I'm facing a big problem. I have two environments installed on the same physical machine.
I have ALSB and WLI servers running out there.
Environment 1 - WLI port running at 7011 domain name : stp_wli_domain and ALSB port running at 8011 domain name: stp_alsb_homo1 - folders- stp_wli_domain / stp_bea_alsb_homo
Environmnet 2 - WLI port running at 7211 domain name : stp_wli_domain2 and ALSB port tunning at 8211 domain name : stp-alsb_homo2 - folders - stp_wli_domain2 / stp_bea-alsb_homo2
Everything was working fine, but these days I had install new deployments on both environment and I got this error :
java.lang.IllegalArgumentException: Registered more than one instance with the same objectName : stp_wli_domain:ServerRuntime=wli_wls01,Name=stp_wli_domain,Location=wli_wls01,Type=AIRuntime new:com.bea.wlai.management.AIRuntimeMBeanImpl@bcf22dc existing com.bea.wlai.management.AIRuntimeMBeanImpl@de02e6c
The weird is : There is no same object name, as you can see, domains are different, folders are different and ports are diferrent, including multicast addresses.
Have you guys seen this before ?
I'm under pressure here, 'cause some projects had stopped to work.
Please I would appreciate any help.
Tks.
EdsonHI there, thanks for attention..
See ...
There's a lot of confusion with these env's .
I did not built this, so... I'm cleaning my hands.... anyway... :)
I must fix....
Well basically if we have two env's, so we have different project each one right ?
Ok, but I was told that if you have on the same network and same physical machine the name of AdminServer as "AdminServer" in all domains, so it goes with problems... I never heard about it... but is a good practice you put the names for example :
WLI - WLIAdminServer
ALSB - AlsbAdminServer
WLI2 - WLiadminServer2
ALSB2 - ALsbAdminServer2
I would do it.. this way..
But how it wasn't me...
We got..
WLI - WliAdminServer
ALsb - AdminServer
WLI2 - AdminServer
ALsb2 - AdminServer
Have you got it ?
So... I was told that this could be a problem, almost all AdminServers with the same name... guess what ?Some Projects are back to work. but not at all.. only some.. so I 'm breathing better now... but I would like to know if you seen this before ?
I would appreciate your help again.
Unfortunately there's no detailed stack trace to track this
Tks. -
Why do we need more than one retained earnings accounts & what is the use?
Hi FI Experts,
Why do we need more than one retained earnings accounts, what is the precise use of two?
I know the retained earnings account is used to carry forward the balances during the year end to the balance sheet and there by making the p&L A/cs balances as zero.
I guess the second one is used for different valueations for example as depreciation accounts for different valuations will have different retained earnings accounts.
Kindly correct me if I am wrong and eloborate on the use having more than one retained earnings accounts.
with regards
Ramesh YHi,
Well, separate retained earnings accounts are used for parallel financial reporting, it means when you need to report in accordance with, for example, local GAAP and IFRS or US GAAP at the same time. Several retained earnings accounts are necessary when the company chooses account based approach for parallel reporting. (GL accounts are broken down into several groups, for example you use different accounts for IFRS valuation, for local GAAP and they are also shared accounts common for both principles.)
m. -
Connect more than 3 router with WDS
hi,can i connect more than 3 router with WDS,in need to connect 8 wifi router with wireless, plz help me,Tnx
Its not possible you can try the same with access points.
-
When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?
mostafa182 wrote:
... how I can solve this problem?
The Basic Troubleshooting Steps are:
Restart... Reset... Restore from Backup... Restore as New...
Restart / Reset
http://support.apple.com/kb/ht1430
Backing up, Updating and Restoring
http://support.apple.com/kb/HT1414
If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
Be sure to make an appointment first... -
HT202213 How can I authorize more than 5 computers with the same Apple ID?
Somebody knows how to authorize more than 5 computers with the same Apple ID? I have One Apple IMac, Apple TV, I-PAD, 2 HP PC's, One I-Phone and one I-Pod Touch. I would like to have the possibility to use as I wish the same Apple ID on one of those without deauthorizing another one.
"Somebody knows how to authorize more than 5 computers with the same Apple ID? "
You cannot.
Authorization applies ONLY to computers. Ipods/ipads/iphones/Apple TVS are NOT authorized at all. -
Is there a way to delete more than one photo at a time in the Photo application?
Is there a way to delete more than one photo at a time in the application Photos in the iPad? Thanks.
The links below have instructions for deleting photos.
iOS and iPod: Syncing photos using iTunes
http://support.apple.com/kb/HT4236
iPad Tip: How to Delete Photos from Your iPad in the Photos App
http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
Another Way to Quickly Delete Photos from Your iPad (Mac Only)
http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
How to Delete Photos from iPad
http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
How to: Batch Delete Photos on the iPad
http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
(With iOS 5.1, use 2 fingers)
How to Delete Photos from iCloud’s Photo Stream
http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
Cheers, Tom -
How can i use Itunes to update more than one IPad with more than one owner
How can i use Itunes to update more than one IPad with more than one owner? I own an IPad and my wife owns an IPad. I want to use my system to update both IPads. We have different Apple Accounts and different applications. Is this possible?
Of course, that is too easy. I am such a bonehead.
Maybe you are looking for
-
How can you delete songs off the ipod without deleting songs off your itunes library?
How can you delete songs off the ipod without deleting songs off your itunes library? My son's ipod automatically synced all the songs in my library to his ipod which he now wants to get rid of. Is there a way to delete them all without me having t
-
Problem with transaction CG3Y - Path does not fit in Source file field.
Hi colleagues, I need to download some PDF files from a folder in AL11. But when I try to enter the source file path in transaction CG3Y, in the first field "Source file on application server" I cannot enter the full path of the file. Apparently this
-
ODI 10.1.3.5 with planning & essbase 11.1.2.1
Hi All, I installed Hyperion in 11.1.2.1 64bit, Oracle Database 11g, ODI 10.1.3.5 64bit in windows environment. ODI works fine when connecting to relational database, but when tring to connect to planning or essbase, a driver error occurred. Does any
-
Drivers for Presario V2000 Laptop
I recently performed a clean reinstall of XP and having problems finding drivers for the following three: 1. PCMCIA Texas Instruments PCIxx21/x515 Card Bus Controller 2. PCMCIA Texas Instruments Integrated Flash Media PCIxx21Controller (H) 3. SM Bus
-
Bi 7.o query design help
Hi SAP Gurus, I am new to BI, and am trying to design a query using BEx , Does anyone have steps by step procedure with screen shots for query designing and reporting in BI 7.O Thanx in advance