24 Topics

Member Avatar for
Member Avatar for deolalkar_pooja

Hello to all, I have following simple Applet program. import java.applet.*; import java.awt.*; public class myapp1 extends Applet { Label l1, l2, l3, l4; TextField t1; TextArea t2; Checkbox c1,c2,c3,c4,c5,c6; CheckboxGroup cg; Button b; public void init() { l1=new Label("Enter your name: ", Label.RIGHT); t1=new TextField(20); l4= new Label("Enter your …

Member Avatar for deolalkar_pooja
0
249
Member Avatar for teppuus

Hello, I am trying to create an MDI application and am having problems with one of the frames. Walking through the errors, the first error points to a list generated by Netbeans code that I think is the null problem. When I look further down the error list, I get …

Member Avatar for JamesCherrill
0
1K
Member Avatar for phil.sutton

I am new to Java, and I have been trying to get an assignment coded and keep gettin java.lang.NullPointerException in Main Class.java:39. Ok, no prob. Unfortunately I can't quite get this fixed. Any suggestions? I'm using Eclipse Juno. Also, any suggestions on any books, sites, etc that review java in …

Member Avatar for NormR1
0
307
Member Avatar for leiger

This code works perfectly fine when I run it as a class file (the font is located in the same directory) - however when I package it into a JAR file it can't find the font and the program crashes. The font is definitely being included in the JAR archive, …

Member Avatar for karlmeier
0
4K
Member Avatar for nickecarlo

I can't figure out why I get the NullPointerException on Line 223. Would appreciate any help whatsoever. Sorry about the spacing below. Some of the code appears messy. Toggle Plain Text and it should look better. [CODE]/* Section 1: Import Statements. Imports the Scanner class and the IO Package. */ …

Member Avatar for nickecarlo
0
216
Member Avatar for sharvil_maniyar

run: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.sun.java.swing.plaf.nimbus.NimbusStyle.init(NimbusStyle.java:418) at com.sun.java.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:359) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:927) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:605) at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:896) at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:275) at javax.swing.plaf.synth.SynthLabelUI.updateStyle(SynthLabelUI.java:53) at javax.swing.plaf.synth.SynthLabelUI.propertyChange(SynthLabelUI.java:232) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at java.awt.Component.firePropertyChange(Component.java:8128) at java.awt.Component.setName(Component.java:935) at javax.swing.plaf.synth.SynthComboBoxUI$SynthComboBoxRenderer.getListCellRendererComponent(SynthComboBoxUI.java:409) at javax.swing.plaf.basic.BasicComboBoxUI.getDisplaySize(BasicComboBoxUI.java:1334) at javax.swing.plaf.basic.BasicComboBoxUI.getMinimumSize(BasicComboBoxUI.java:903) at javax.swing.plaf.basic.BasicComboBoxUI.getPreferredSize(BasicComboBoxUI.java:892) at javax.swing.JComponent.getPreferredSize(JComponent.java:1634) at javax.swing.GroupLayout$ComponentSpring.calculateNonlinkedPreferredSize(GroupLayout.java:2944) at javax.swing.GroupLayout$ComponentSpring.calculateNonlinkedMinimumSize(GroupLayout.java:2930) at javax.swing.GroupLayout$ComponentSpring.calculateMinimumSize(GroupLayout.java:2897) at javax.swing.GroupLayout$Spring.getMinimumSize(GroupLayout.java:1315) at javax.swing.GroupLayout$ComponentSpring.calculatePreferredSize(GroupLayout.java:2904) …

Member Avatar for JamesCherrill
0
788
Member Avatar for slasherpunk

I'm trying to run a simple servlet that counts the number of times a user visits the page using cookies but I'm getting the following error. I thought that NullPointerException was because there were no cookies at all in the browser. But after checking I found a couple of cookies …

Member Avatar for NormR1
0
327
Member Avatar for shibu2all

Can anyone please help me out in removing this error Exception in thread "main" java.lang.NullPointerException at java.awt.Container.addImpl(Container.java:1045) at java.awt.Container.add(Container.java:365) at Client.<init>(Client.java:33) at Client.main(Client.java:17) [CODE=java] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.net.*; public class Client { JFrame frame1; JList list; JList list1; JTextField tf; JButton send; JButton lout; …

Member Avatar for shibu2all
0
229
Member Avatar for roshan_iiita

While running basic HelloWorld program using JSAPI, it is showing error "java.lang.NullPointerException at HelloWorld.main(HelloWorld.java:11)" Following is the code: [CODE]import javax.speech.*; import javax.speech.synthesis.*; import java.util.Locale; public class HelloWorld { public static void main(String args[]) { try { // Create a synthesizer for English Synthesizer synth = Central.createSynthesizer(new SynthesizerModeDesc(Locale.ENGLISH)); // Get it …

0
137
Member Avatar for chiiqui

I am working on may code and I received a null pointer error , how do I fix this? all I wanted to do was remove the selected array here's my code [CODE] import java.util.Scanner; public class Game { public static void main(String args[]){ Scanner input = new Scanner( System.in …

Member Avatar for Majestics
0
240
Member Avatar for wiredin

I need to make 45 objects of a nested class within my main class. I have tried instantiating the objects inside the main class' data fields and then inside of its default constructor. After being instantiated, i need to add 15 of the objects to 15 more arrays (each object …

Member Avatar for NormR1
0
168
Member Avatar for dante5458
Member Avatar for SMITA6076

I have two classes. The first class is called [ICODE]EmployeePayRoll.java[/ICODE] (this compiles fine) and the second is called [ICODE]TestEmployeePayRoll.java[/ICODE] (this does not compile). The trouble I'm having is that I'm trying to pass in methods as parameters when I instantiate my objects in the main method of the test class. …

Member Avatar for SMITA6076
0
291
Member Avatar for manish250

Hello all I am using reading a config file in which there is a entry [CODE]code_list="515,522,560,000" [/CODE] while i am reading this string in my java application and using split on it and then assigning it to a string[].it is giving null pointer exception.needed code is as follows [CODE] static …

Member Avatar for manish250
0
2K
Member Avatar for manish250

Hello all can anybody tell me why i am getting null pointer exception. [CODE] String mesg=""; try { URL u = new URL(strOp); BufferedReader r = new BufferedReader(new InputStreamReader( u.openStream())); String s=""; while((s=r.readLine())!=null) System.out.println(s); if(s.equals("SUCCESS")) mesg = mesg+"Your Request has been Processed.you will be intimated by a sms soon"; else …

Member Avatar for manish250
0
176
Member Avatar for srinivas88

Help with DOM.I am trying to access the nodes acc. to their levels in an xml file.reached upto 3-4 levels then getting a nullpointer exception.Please help...wat datastructure would better suit this.i need to index all the nodes.the xml file is cs.xml given under and the java code below tht. <department> …

Member Avatar for peter_budo
0
224
Member Avatar for 0157h7

I keep getting a null pointer on this assignment and I figure that I can't fix it because my logic is deeply flawed somewhere. Here is the code that I have: [CODE] import java.util.*; import java.io.*; public class Project1 { public static class MapPoint { private String elevation; private String …

Member Avatar for ztini
0
163
Member Avatar for Sunshineserene

Hi all, this is my codes. [CODE]import java.io.*; public class Testing3 { static double[][] mydouble; static int a, b; static double d; static String[] temp; public static void main(String args[]) throws Exception { try { BufferedReader in = new BufferedReader(new FileReader("C:\\Users\\Serene\\Documents\\Major Project\\Alignment Algorithms\\Testing2.txt")); //reading files in specified directory String str, …

Member Avatar for Sunshineserene
0
2K
Member Avatar for nickoooname

Hey guys, im getting a null pointer exception... but i dont know what is wrong. Im trying to get data from a hashmap, and place it in a swing tabel. [CODE=java] ArrayList planes_array[] = null; //planes_array[0] = new ArrayList(); for(int i=0; i<planes.size(); i++) { ArrayList tmp_array = new ArrayList(); tmp_array.add("1"); …

Member Avatar for JamesCherrill
0
138
Member Avatar for pi_lord12

I am creating a game in which I import images from files to represent characters, etc. I have created a class called Contents which represents anything that can be placed on a tile of the gameboard. A subclass of Contents (by several levels) is Wizard, to create a wizard character. …

Member Avatar for pi_lord12
0
143
Member Avatar for musikluver4

I have spent over a WEEK trying to figure out why my code isn't working. It's a long code, I will post it all but I will break down the code as I explain. First off, I have called double[] arrays and then initialized them later on in the program …

Member Avatar for musikluver4
0
3K
Member Avatar for InsaneOstrich

I have to write a JUnit test method for a short program that lets the user add/remove/browse images in a collection. (Adding an image is done with a JFileChooser) The test method that I wrote exhibits some really bizarre behavior; it passes every so often, but fails most of the …

Member Avatar for InsaneOstrich
0
543
Member Avatar for Ecliptical210

Hey guys, I'm creating a Maze class along with a client class where it allows the user to input a direction (U/L/R/D), and then the validity of the move will be returned as well as the new position of the maze. So far, I've got this, but when I try …

Member Avatar for rue64ja
0
231
Member Avatar for keicola

I'm trying to read a file which contains: Dante Beatrice 3 5 and put them into an array. Then I will assign the values of each member of the array to static variables. when i run the main class of my project, it throws a NullPointerException starting from the line …

Member Avatar for keicola
0
236

The End.