32,199 Topics
| |
Hey everyone. I am supposed to create a program that will input the miles driven and gallons used for each tank full of gas. program has to calculate and display the miler per gallon obtained for each tankful and print the combined miles per gallon for all tank fulls up … | |
I am creating a GUI program with java and when I run it, I get this stack of errors. [CODE] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at ButtonPanel$AllocateListener.actionPerformed(ButtonPanel.java:52) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at … | |
The problem I'm having is that I have a min heap class that is created with java generics. In the class where I use the min heap class(call it sorter) I have a float array, which is full of primitive float values. The constructor for the min-heap class takes a … | |
java float example float f1 = 5.5f; float f2 = 5.4f; how would you initialize a static float without using the wrapper class? static float f1 = 5.5f would that be correct? | |
I am no good with programming. I am only taking it because I have to. I am majoring in Business Information Technology with Computer Network Admin. I have yet to figure out why I have to take programming if I am not going to really need it. Anyhow, I am … | |
Here i draw chessBoard and adjust affect of appearin blue rect when player press by mouse on the above two rows but the pawn image not appear . I made [B]intializingIcoss()[/B] on class[B] BoardGame[/B] then the method appear but when the image not appear when i put the method on … | |
Hello! I'm in a dilly of a pickle here and can't seem to get any answers on the web. My problem is one of EOF token recognition with CUP. When I define EOF as one of my terminals, CUP complains: Duplicate terminal (EOF) created So, I take it out, and … | |
hey guys, i'm new to java servlets..i have been making a website using java servlets on stock market and stuff...now what my query is that i want to retrieve data from database(ms-access) and display it on my html page.... i don't have much knowledge about html so i took a … | |
Hey, I've been doing this little program to check if a number is a Keith number, and for some reason it's not working. I've gone over the code a few times but still can't detect the error. Could you please help? [CODE]static boolean isKeith(int n) { int sz=Func.sumDg(n); int arr[]=new … | |
Hi all, I am building distributed calculator using java server, corba, .net client side UI that can load plugins at server side on runtime. plugins are .class files stored on server side and on client side plugins are added by getting list of all plugins(.class) in "plugins" folder and adding … | |
This error is triggerred whether the bpressed objects is an Integer or a string I have defined the seatno as a number type in ms access and status as a text type in ms access I hav tried [CODE]bpressed=Integer.parseInt(ae.getActionCommand())[/CODE] But it does not make any difference to the outcome Thanks … | |
if(jText.getText==" "){ } //it will not Work & a Information is come up that "Comparing String using == ,!=". So,what I do for this code please give me answer of this Question in java. | |
I want to create a a program in which i enter a word and the program counts the number of alphabets used in the word and display as output !! I know its simple but i am just a beginner and my teacher wants to submit this as assignment this … | |
I have to teach someone XML revalidation by tomorrow morning and I don't have much idea about it. It is something about XML schema and you have to revalidate it... Can you give me some idea about how I should go about it? [CODE]Given two abstract XML Schemas, S = … | |
I am trying to write a program to display the unicode character when a user enters a unicode character code. ex: If the user enters: "\u00C3" in the textfield, I want to display a capital "A" with a tilda (~) over the top of it. Here's my code so far: … | |
Hello. I have two questions about iText. The pdf file exactly has to be like the word file that was sent to me. In the word file; the character is Times New Roman and its 10 puntos. But in the pdf file when i try to do Times.Roman and 10 … | |
I suppose to write a grammar file for assembly language program by using Java in ANTLR .. but I don't know from where should I start .. and what should I do.. I am lost.. any expert with this subject could help me :( I have read a lot but … | |
[code] import javax.swing.*; import java.awt.GridLayout; import java.awt.event.*; import java.text.*; public class TFE extends JFrame implements ActionListener { public TFE() { str txtfNum1,txtfNum2,lblAnswer; setLayout(new GridLayout(3,2,5,5)); add(new JLabel("First Number:")); add(txtfNum1); add(new JTextField(10)); add(new JLabel("Second Number:")); add(txtfNum2); add(new JTextField(10)); add(new JLabel("Total Summation:")); add(lblAnswer); txtfNum1.addActionListener(this); txtfNum2.addActionListener(this); } public void actionPerformed(ActionEvent e) { String str; … | |
Write a class Employee. An employee has a private first name (string), private last name (string), private job title (string), private employment ID (string), private monthly income (double), private joining date (string), and private mailing address (string). Provide a default constructor, a parameterized constructor, and a clone constructor. Write separate … | |
i have this code [code=Java]//***************************************************** //Angles.java // // // //***************************************************** import java.util.Scanner; public class Angles { public static void main (String[] args) { double degree=1/360; double minutes=1/60; double seconds=1/60; double PI=3.14159;; Scanner scan = new Scanner(System.in); // takes the first angles from the user System.out.print("Enter the Degrees of the first … | |
I'm attempting to create an applet for teaching languages, it plays a sound, then lets you record your voice, then plays back the sound again and then your voice. It has two buttons, one to move on to the next word, and another to repeat the same word (NOTE: repeat … | |
The Question is: Write, compile ad test a program that stores two integers and allow the user to enter a character. If the character is A, add the two integers, if it is S subtract the second integer from the first one and if it is M multiply the two … | |
Hi, I'm doing a matrix of array n I have to assign each column with a letter or number so that when I shuffle the letters/numbers, it will print out accordingly. this is like the transposition cipher. I have 2 problems. 1. my matrix is not printing out like i … | |
Hi, all. I use FontMetrics for giving character width and it work!, but not for all fonts. For some fonts (for example "Times New Roman") for some chars 'f', 'j' - I give wrong char width and 'f' is overlap next char on drawing (top tail is not included in … | |
hi there i have a problem where i cannot find a way to make a java program to Write a program which asks the user how many days he will be working. Then calculate and print the amount of money he will earn if he is paid £1 for day … | |
I'm developing a bluetooth messaging application which sends text messages between devices. My problem is when I connect more than 2 devices. After sending some data between them (let us say 3 devices) I get this exception: javax.bluetooth.BluetoothStateException: too mach concurent requests at com.sun.kvem.jsr082.bluetooth.ServiceSearcher.start(ServiceSearcher.java:67) at com.sun.kvem.jsr082.bluetooth.DiscoveryAgentImpl.searchServices(DiscoveryAgentImpl.java:226) at javax.bluetooth.DiscoveryAgent.searchServices(DiscoveryAgent.java:259) at BSearch.deviceDiscovered(BSearch.java:78) … | |
Hi there, I'm a new poster to these forums. A group of amateur programmers and I, some with C++ knowledge, others with Java knowledge, are planning to create a group project. My question is, is there a way to combine segments of Java and C++ code together into one program … | |
I want to how to to use the constructor CreditCard, how to use the method "getNumber". | |
hi there! im really having a hard time dealing with this problem.. hope someone can help me. i would really appreciate it.. the problem goes like this.. conical cups are to be made from a circular paper by removing a sector. by closing the remaining part of the circle, a … | |
Hi, I'm getting a [QUOTE]java.lang.NoSuchMethodError: main Exception in thread "main" [/QUOTE] error when trying to run this code. I have some variable being returned to the main method, but I don't know how else to write this program without doing that. Any help would be greatly appreciated. Thank you. [CODE]import … |
The End.