My program in Java doesn't work
Could anyone can help me in making this small project for me. I'm making sample project about Student Transcript but it doesn't want to work properly. So please kindly try to help me.
This is the code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Transcript extends JFrame {
private JLabel lbl1, lbl2, lbl3, lbl4, lbl5, lbl6, lbl7, lbl8, lbl9, lbl10, lbl11, lbl12, lbl13;
private JTextField txt1, txt2, txt3, txt4, txt5, txt6, txt7, txt8, txt9, txt10, txt11, txt12, txt13;
private JButton buttoon;
private JTextArea textarea1;
private int int1, int2, int3 ,fin1, fin2;
String str1, str2, str3;
public Transcript()
super( "MITM Students Transcript" );
Container container = getContentPane();
container.setLayout( new FlowLayout() );
lbl1 = new JLabel("Enter Name: ");
container.add(lbl1);
txt1 = new JTextField(15);
container.add(txt1);
lbl2 = new JLabel("Enter Id: ");
container.add(lbl2);
txt2 = new JTextField(5);
container.add(txt2);
lbl3 = new JLabel("Date: ");
container.add(lbl3);
txt3= new JTextField(20);
container.add(txt3);
lbl4= new JLabel ("Semester: Spring 2008");
container.add(lbl4);
lbl5= new JLabel ("Course Code 1:");
container.add(lbl5);
txt4= new JTextField(5);
container.add(txt4);
lbl6= new JLabel ("Course Name :");
container.add(lbl6);
txt5= new JTextField(8);
container.add(txt5);
lbl7= new JLabel ("Credit Marks :");
container.add(lbl7);
txt6= new JTextField(5);
container.add(txt6);
lbl8= new JLabel ("Course Code 2:");
container.add(lbl8);
txt7= new JTextField(5);
container.add(txt7);
lbl9= new JLabel ("Course Name :");
container.add(lbl9);
txt8= new JTextField(8);
container.add(txt8);
lbl10= new JLabel ("Credit Marks :");
container.add(lbl10);
txt9= new JTextField(5);
container.add(txt9);
lbl11= new JLabel ("Course Code 3:");
container.add(lbl11);
txt10= new JTextField(5);
container.add(txt10);
lbl12= new JLabel ("Course Name :");
container.add(lbl12);
txt11= new JTextField(8);
container.add(txt11);
lbl13= new JLabel ("Credit Marks :");
container.add(lbl13);
txt12= new JTextField(5);
container.add(txt12);
buttoon = new JButton ("Get the GPA");
container.add(buttoon);
buttoon.addActionListener(
new ActionListener() {
public void actionPerformed (ActionEvent event)
str1 = txt6.getText();
int1 = Integer.parseInt(str1);
str2 = txt9.getText();
int2 = Integer.parseInt(str2);
str3 = txt12.getText();
int3 = Integer.parseInt(str3);
fin1 = int1 + int2 + int3;
fin2 = fin1 /3;
textarea1.append( txt1 + "\n" + " The GPA of this student is: " + fin2);
textarea1 = new JTextArea(18,36);
textarea1.append("");
textarea1.setEnabled( true );
textarea1.setDisabledTextColor( Color.BLUE );
container.add(textarea1);
setSize( 580, 480 );
setVisible( true );
public static void main( String args[] )
Transcript application = new Transcript();
application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
JAAVA wrote:
Could anyone can help me in making this small project for me. I'm making sample project about Student Transcript but it doesn't want to work properly. So please kindly try to help me.What does "not work properly" look like?
C'mon - a stack trace, an error message, a description of what you have versus what you want. Anything than postnig a mess of code, sitting back, and saying "Please kindly try to help me." That passiveness tends to not do well here.
Read this:
http://www.catb.org/~esr/faqs/smart-questions.html
%
Similar Messages
-
Java doesn't work on safari / xp
Downloaded the latest Safari, 5.1.7, for Windows XP
Downloaded the latest Java, JRE as well as tried JDK, 7.04 and configured for IE and Safari.
Java.com test works on IE, but on Safari, refers to
C:\Program Files\Oracle\JavaFX 2.1 Runtime\bin\server\jvm.dll
There is no server directory, nor any jvm.dll anywhere in the Oracle install.
What's wrong??
Help!Ok, 3 days and no responses. I guess Java doesn't work on Safari/XP. Time to switch...
-
HT1338 java doesn't work and there is no update (via apple) available.
Now running mountain lion. Unfortunately java doesn't work and there is no update (via apple) available. What do I do?
Open Terminal (Applications/Utilities/Terminal.app) and type
java -version
press 'return' on the keyboard.
Either
1. You get a version number for Java, in which case enable Java in
Applications/Utilities/Java Preferences.app
Or
2. You get an installer window pop up. After clicking through and installing that, enable Java as in 1. above. -
Java doesn't work on my comp!
i have recently formatted my computer, and re-intalled everything back, i have windows xp running and i just downloaded the java v. 1.4 standard edition, but it doesn't seem to work, i don't know why, it does complie with javac but when i run with java <name> it throws and Exception in thread "main" java.lang.NoClassDefFoundError: with the hello.java!, I don't know what's wrong please help me out, i have already compiled it... if anyone is wondering.
Still doesn't work! i don't know why... if anyone can help me out...
i compile a simple program on win 98 and it runs with java 1.3;
now on win xp i compile the program and the .class is created but when i run the java and name of the program it gives me the -java.lang.noClassDefFoundError: <name> i don't know what is it... -
Java works in Internet Explorer but doesn't work in FireFox.
My installed Java-related programs are:
Java 7 Update 11
Java 7 Update 11 (64-bit)
Java SE Development Kit 7 Update 11
Java SE Development Kit 7 Update 11 (64-bit)
I don't have JavaFX or anything else. I need both kits for Eclipse and other things.Quote: ''PS Java is obviously working as I visit a site that blocks use of "right mouse click" and that is fine.''
To avoid confusion:
*http://kb.mozillazine.org/JavaScript_is_not_Java
You should see an enabled Java plugin in Tools > Add-ons > Plugins and Java should show on the about:plugins page if Java is installed properly.
*http://kb.mozillazine.org/Java#Windows_installation_issues
*http://www.java.com/en/download/help/testvm.xml
*http://www.java.com/en/download/installed.jsp -
Why my program on SAX doesn't work?
Hi,
I am learning SAX by myself.
I read the article on this page:
http://java.sun.com/xml/
jaxp-1.1/docs/tutorial/sax/2a_echo.html
And I pasted the program
Echo.java and slideSample.xml
And I downloaded the crimson.jar jaxp.jar and xalan.jar
when I run
javac -classpath .\jaxp.jar;.\crimson.jar;.\xalan.jar Echo.java
I get a single Error.
cannot resolve symbol
symbol: method parse (java.io.File,org.xml.sax.helpers.DefaultHandler)
location: class javax.xml.parsers.SAXParser
saxParser.parse(new File(argv[0]), handler);
1 error
The first time i saw this I thought it might because when I pasted the file down I made some mistake. So that I download another copy of
Echo01.java and slideSample01.xml
when I run javac Echo01.java
the same thing happened.
I believe that these sample of course have been tested.
What's wrong?Hi,
first make sure you've got the lastest version of Xalan (2.2 D6) if done they may have a problem with jaxp try to compile without jaxp and if it's really needed put it at the end of the classpath for xalan libs to be used first.
I had a problem with a servlet wich used xalan, it didn't work because jaxp libs were used first so I remove it from the classpath and it is now working.
Hope this helps -
I installed Java manually from the apple web site. however when I open a web page that runs java application the page doesn't work. I had trouble initially intalling java automatically, I got a dialog box saying that I was not connected to the network. How can I get run Java correctly in my computer?
When you use Google Chrome (uses it's own Java), you get this message in a separate window:
The requested resource (/finans/header.jsp) is not available.
Also tried it with Internet Explorer 8 in Windows XP. It doesn't works the same as Safari there: -
Program compiles but doesn't work
The folowing program compiles, but it doesn't work, when I type GuessingGame.play(5); into the interactions pane, I get the message
No 'play' method in 'GuessingGame'. All my brackets line up and I can't see where the problem is. I would definitely apreciate it if you could help!
/** Allows a user to play a number-guessing game.
The constructor takes the integer to be guessed. */
public class GuessingGame {
int theNumber; //The number to be guessed by the user.
int guessNumber; //The users guess.
public void play(int g){
theNumber=g;
guessNumber = Integer.parseInt(JOptionPane.showInputDialog("Guess an integer."));
while(guessNumber!=theNumber){
if(guessNumber > theNumber){
JOptionPane.showMessageDialog(null, "Your guess was too high. Guess again.");
else if(guessNumber < theNumber){
JOptionPane.showMessageDialog(null, "Your guess was too low. Guess again.");
JOptionPane.showMessageDialog(null, "You're right!");Sorry, it's just that no-one was answering, it took over 2 hours to get a response. I finally got some help now(with the topic as 'Fun to be had by all!'), so you can now just ignore all of them.
-
Java doesn't work in mozilla 0.9.3
hello,
I just installed the mozilla 0.9.3 but the java plugin doesn't work. It comes with the Java2. It has the sym-link in the plugins directory but still doesn't work?? I tried looking in the mozilla website but couldn't find an answer to my question.
I also have loaded on the same machine netscape 4.78. I tried loading the JRE 1.3.1_01, but that also doesn't work. I'm sure the sym-links are in the correct places according to the Sun installation instructions......
What is causing this???
thank you,
OskarI had the exact same problem with mozilla 0.9.3 and using the blackdown 1.3.1 java plugin on Mandrake Linux 7.2. Then I formatted my hard drive ( not because of this problem...ha ha ) and when i installed mozilla i got the plugin to work. What i did was, create the symbolic link ( as suggested in the installation instructions ), then started mozilla, then shut mozilla down, then started mozilla for a second time ( and the java plugin then showed up in the 'about plugins' page), then i viewed a web page with an applet and moziila crashed.....ha ha....and from then on it has worked perfectly.........i cant remember where i read about this bug..(sorry)...
anyway, to summarise you need to restart mozilla twice after making the symbolic link before viewing a page containing a Java applet. (i dont know whether you will have to reinstall mozilla to get this to work ?..seeing as you have already tried this once? ) Good luck ( sorry if this reply is a bit of a mess !!!) -
I might have screwed something up...
but whenever I try to upload pictures on facebook... doesn't work..
any thing Java doesn't workHi... did you do something you should tell us about?
How much Free Space do you have on your Hard Drive?
Could be many things, we should start with this...
"Try Disk Utility
1. Insert the Tiger Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
3. Click the First Aid tab.
4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
5. Select your Mac OS X volume.
6. Click Repair. Disk Utility checks and repairs the disk."
http://docs.info.apple.com/article.html?artnum=106214
Then Safe Boot , (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it finishes.
The usual reason why updates fail or mess things up, or things don't load/run, is if Permissions are not fixed before & after every update, with a reboot... you may get a partial update when the installer finds it doesn't have Permissions to change one obscure little part of the OS, leaving you with a mix of OS versions.
Some people get away without Repairing Permissions for years, some for only days.
If Permissions are wrong before applying an update, you could get mixed OS versions, if Directory is the slightest messed up, who knows!
If many Permission are repaired, or any Directory errors are found, you may need to re-apply some the latest/biggest updates again, or even do an A&I if you have enough free disk space.
The combo update for PowerPC-based Macs...
http://www.apple.com/support/downloads/macosx10411comboupdateppc.html
The combo update for Intel-based Macs...
http://www.apple.com/support/downloads/macosx10411comboupdateintel.html
Repair Permissions before & after re-install, then reboot again each time.
If all the above fails, then it appears to be time for a relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
http://docs.info.apple.com/article.html?artnum=107120
Just be sure to select Preserve Users & Settings.
I only use Software Update to see what is needed, then get them for real via...
http://www.apple.com/support/downloads/
That way I can wait a week or so, check the forums for potential problems, and get Permissions & such in order before installing.
If it appears to be time for An Archive & Install, which gives you a new OS, but can preserve all your files, APPs, pics, music, settings, etc., as long as you have plenty of free disk space...
http://docs.info.apple.com/article.html?artnum=107120
Be sure to use Preserve Users & Settings. -
With Safari 3.1.1 et FireFox 5.0 on the web often connections using Java do not work , and i get the message :
UnsatisfiedLinkError: GetProxyConfigURL
I can't found "ProxyConfigURL" on the web, and after I have reinstalled Java, it's the same message!
If any of you know what I'm talking about please help.Thanks.
All the error message :
java.lang.UnsatisfiedLinkError: getProxyConfigURL
at sun.plugin.net.proxy.MacOSXProxyConfig.getProxyConfigURL(Native Method)
at sun.plugin.net.proxy.MacOSXProxyConfig.getBrowserProxyInfo(MacOSXProxyConfig.ja va:30)
at sun.plugin.net.proxy.PluginProxyManager.reset(PluginProxyManager.java:108)
at sun.plugin.AppletViewer.initEnvironment(AppletViewer.java:574)
at jep.MyJavaRunTime.initJavaRunTime(MyJavaRunTime.java:37)
at jep.AppletHandlerFactory.initProperties(AppletHandlerFactory.java:404) -
Very recently my java stopped working. I have os x 10.5.8 loaded on an imac. same issue with my macbook running the same os? Any ideas?
Just checking, this is Java, not Javascript?
BTW, it's recommended to actually disable Java so you don't get the FlashBack infection...
Disable Java in your Browser settings, not JavaScript.
http://support.apple.com/kb/HT5241?viewlocale=en_US
http://support.google.com/chrome/bin/answer.py?hl=en-GB&answer=142064
http://support.mozilla.org/en-US/kb/How%20to%20turn%20off%20Java%20applets
Flashback - Detect and remove the uprising Mac OS X Trojan...
http://www.mac-and-i.net/2012/04/flashback-detect-and-remove-uprising.html
In order to avoid detection, the installer will first look for the presence of some antivirus tools and other utilities that might be present on a power user's system, which according to F-Secure include the following:
/Library/Little Snitch
/Developer/Applications/Xcode.app/Contents/MacOS/Xcode
/Applications/VirusBarrier X6.app
/Applications/iAntiVirus/iAntiVirus.app
/Applications/avast!.app
/Applications/ClamXav.app
/Applications/HTTPScoop.app
/Applications/Packet Peeper.app
If these tools are found, then the malware deletes itself in an attempt to prevent detection by those who have the means and capability to do so. Many malware programs use this behavior, as was seen in others such as the Tsunami malware bot.
http://reviews.cnet.com/8301-13727_7-57410096-263/how-to-remove-the-flashback-ma lware-from-os-x/
http://x704.net/bbs/viewtopic.php?f=8&t=5844&p=70660#p70660
The most current flashback removal instructions are F-Secure's Trojan-Downloader:OSX/Flashback.K.
https://www.securelist.com/en/blog/208193454/Flashfake_Removal_Tool_and_online_c hecking_site
More bad news...
https://www.securelist.com/en/blog/208193467/SabPub_Mac_OS_X_Backdoor_Java_Explo its_Targeted_Attacks_and_Possible_APT_link -
Hello,
Yesterday I tried to get onto iTunes and was unable to. I keep getting this message:
Itunes.exe - Unable to locate component.
This application has failed to start because MSVCR80.dll was not found.
Re-installing the application may fix this problem.
I have tried to uninstall and re-install the program several times but cannot get it to work. Now I get this message:
iTunes was not installed correctly. Please reinstall iTunes.
Error 7 (Windows error 126)
I have tried to do what I can but am not really iTunes savy and would like to get this issue resolved. Can anyone help me?
THANK YOU!!
CynHello there, Cyn.
The following Knowledge Base article provides some great information for troubleshooting your issue. Keep in mind uninstalling and reinstalling has to be done in a very specific fashion, therefore use the guidelines from this article to accomplish this:
Issues installing iTunes or QuickTime for Windows
http://support.apple.com/kb/ht1926
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro. -
MySQL + Java doesn't work
I've been trying to get a connection using MySQL and Java without luck, I've been messing with every solution I have found in google without luck. It worked the last time I used mysql + java a few months ago (in Ubuntu) but now I can't even get a connection.
MySQL works with PHP, MySQL Administrator and CLI but I just can't get it to work with Java.
Has anybody been able to run Java applications that use JDBC + MySQL in Arch?
The stack trace I get is like the following and it changes a little bit if I use different versions of the Connector
java.sql.SQLException: Server connection failure during transaction.
Due to underlying exception: 'com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
STACKTRACE:
java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1934)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:483)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:992)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2709)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at MySQLConnectTest.main(MySQLConnectTest.java:12)
Last edited by karmapolice (2007-05-22 20:48:25)http://bugs.archlinux.org/task/7256
Added a bug report -
FTP server in java doesn't work well at win os in some status.Why?
As we know,FTP server in java used to use "BufferedOutputStream(socket.getOutputStream())" to complete data transfer.
socket.getOutputStream() returns SocketOutputStream, and SocketOutputStream use native method:socketWrite0 to transfer data.
I writted a FTP server in java that runs at win XP or win 2003 server. FTP client download file through internet,and when file size is large(for example, 5M),the download is failure. But I changed FTP server in C++,the download is ok. These PCs have multi network card commonly.
In the first instance,I thinked my programm may be written wrong. But I have used CrossFTP and DanoFTP at sourceforge.net, they failed too.
I have compared the source code of these FTP server and they are same in data transfer.
There are another strange phenomenon.FTP server at some PC works well. For example,when I install FTP server at another PC.So I think that it is not link problem,and may be relate with PC's configuration?
Any help appreciate.Win XP(sp2) and win 2003 server all have happened. Version of JDK is 6u2. I have doubted with version of JDK, and I changed to JDK 6u10 but problem is same.
By the way, FTP server in C++ work well on these problem machine.
I think the problem is related with configuration of machine(hardware or software), but I want to know where and why.
Thanks for any help.
Maybe you are looking for
-
I hate the mapping in IOS6. Is there a way to roll back to the older OS? When I upgraded I didn't know about the mapping change. I used google maps a lot, for a variety of things. In just a few searches I've found more errors or missing landmarks tha
-
Hi, I am in the process of configuring P-Cards in SRM 5.0 Standalone. I am faced with the following issues: 1. I am not able to see the 'Procurement Card' drop-down field when the shopping cart is being created by the Requisitioner. How do I make thi
-
IPhone 5 battery drain issues!
I was wondering if 6 hours of light usage on 4g/wifi is normal for an iPhone 5. I noticed that when I make a 15 minute call, my battery dropped from 91% to 85%. Also, my battery only lasts about 6 hours total, with very light usage, only texting, we
-
Migration from Macbook Pro, settings are macbook pro
I have migrated my data from Macbook Pro Retina using migration assistance. During the process I didn't allow it to override my current profile, or something. Now when I use terminal, it says Name-Macbook-Pro:~ name $ shouldn't it say Name-Mac-Mini:~
-
Photosmart and Photo imaging had on old printer did not come over on new computer.
Hi, I had a HP photosmart poto imaging on my old computer but it did not come over onto my new computer. I really like this program because when I was copying home pictures for my family it allowed me to choose size of film, size of image and severa