32,199 Topics

Member Avatar for
Member Avatar for shroomiin

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 …

Member Avatar for BestJewSinceJC
0
104
Member Avatar for karen.tao

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 …

Member Avatar for darkagn
0
265
Member Avatar for vtsmokey88

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 …

Member Avatar for BestJewSinceJC
0
121
Member Avatar for axn

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?

Member Avatar for BestJewSinceJC
0
269
Member Avatar for ttuck

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 …

Member Avatar for mrnutty
0
2K
Member Avatar for beshoyatef

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 …

Member Avatar for beshoyatef
0
125
Member Avatar for Sikter

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 …

Member Avatar for masijade
0
1K
Member Avatar for ankiwalia

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 …

Member Avatar for javaAddict
0
119
Member Avatar for kaylors

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 …

Member Avatar for javaAddict
0
120
Member Avatar for msiq08

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 …

Member Avatar for masijade
0
91
Member Avatar for pradeep_09

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 …

-1
53
Member Avatar for atul vishwakarm

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.

Member Avatar for moutanna
0
48
Member Avatar for ayaz.ali

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 …

Member Avatar for surbhi bhasker
0
409
Member Avatar for priteshdesai

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 = …

-2
60
Member Avatar for cgeier

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: …

Member Avatar for cgeier
0
2K
Member Avatar for Xessa

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 …

Member Avatar for peter_budo
0
110
Member Avatar for halona

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 …

Member Avatar for halona
0
106
Member Avatar for xonxon

[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; …

Member Avatar for JamesCherrill
0
134
Member Avatar for ahmedshayan

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 …

Member Avatar for ahmedshayan
0
235
Member Avatar for asong

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 …

Member Avatar for Airshow
0
219
Member Avatar for Room101

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 …

Member Avatar for Room101
0
85
Member Avatar for kreshan_489

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 …

Member Avatar for kreshan_489
-1
324
Member Avatar for phazlyn

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 …

Member Avatar for phazlyn
0
93
Member Avatar for koderz

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 …

0
55
Member Avatar for madmudz

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 …

Member Avatar for masijade
0
92
Member Avatar for Clawsy

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) …

Member Avatar for Clawsy
0
428
Member Avatar for thescroll

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 …

Member Avatar for restrictment
0
38
Member Avatar for ki72

I want to how to to use the constructor CreditCard, how to use the method "getNumber".

Member Avatar for ithelp
-2
68
Member Avatar for baek chay

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 …

Member Avatar for masijade
0
84
Member Avatar for agentgaurav007

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 …

Member Avatar for quuba
0
103

The End.