32,199 Topics

Member Avatar for
Member Avatar for harinath_2007

Hi folks. I encountered a problem. My application works perfectly if i run it from netbeans. Even it works fine when i build my project and run the jar file from the netbeans(dist) folder. But when i copy the jar file to another place(or another drive) , the jar file …

Member Avatar for stultuske
0
352
Member Avatar for nickecarlo

I have this program where when I click start, it starts painting rectangles one on top of the other by storing each rectangle created by paintComponent in an array and then displaying them on the screen. When I click stop, the animation stops. This is all fine and dandy but …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Red_Rain

Hey everyone, I am attempting to add an array of JTextFields to one of my JPanels and for some reason i keep getting errors and the program crashes when i run it. I know i am prob making some noob mistake but this a project for my first Java class …

Member Avatar for mKorbel
0
663
Member Avatar for k22mac

I'm working on learning some basic java programming. I have a project that I've been working on dealing mostly with arrays. I have completed the objective, I'm just not sure that I did it in the most effective way possible. My question here is to see if an experienced java …

Member Avatar for NP-complete
0
286
Member Avatar for brandon66

Hey guys having some troubles here with screen scraping just wondering whats causing it not to pick up the string from the webpage it throws an error. package com.lati.latifoodmenu; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.webkit.WebView; public …

0
73
Member Avatar for harinath_2007

Hi folks. I am learning java from past 5 years and constantly upgrading myself and excited to know interesting classes of java. Whats your favourite class in java? Plz share if you find any new interesting inbuilt class that comes in jdk or even 3rd party is also fine.

Member Avatar for harinath_2007
0
319
Member Avatar for cookiejarvus

So the mission here is to have all the user input data to display to the display panel. I was able to achieve this, however instead of the info display after I click the display button the info will display after clicking on any of the radio button options. Im …

Member Avatar for stultuske
0
198
Member Avatar for subramanya.vl

I know that java.long.String is an immutable class. I need to know different ways on to how create an immutable class in java. What are the pros and cons of immutable class

Member Avatar for stultuske
0
81
Member Avatar for rachelmorg

Hello, I just have a quick question, I have two while loops that don't quite do what I want while (e == true && num != 1) { do statement } while (e == false && num !=1) { do different statement } if (num == 1) { System.out.println(value); } …

Member Avatar for rachelmorg
0
141
Member Avatar for javaprog200

Hello, I am trying to understand what a byte array is. public class ByteArrayExample { public static void main (String args[]) { byte[] array = "1".getBytes(); System.out.println (array); } } The output of this program is : [B@44770739 Is this a hexadecimal representation? If any of the members can explain …

Member Avatar for javaprog200
0
217
Member Avatar for manaila

How do I refer to a file that is in the following directory in Java web app: ***webapps/WEB-INF/myfiles/filename*** I have read that this has got to do with relative paths, but I do not understand how to do that.

Member Avatar for subramanya.vl
0
208
Member Avatar for davidthefritz

http://ideone.com/XRMOPI line 43 is throwing this exception and i can't figure out why //Exception in thread "main" java.util.InputMismatchException //at java.util.Scanner.throwFor(Unknown Source) //at java.util.Scanner.next(Unknown Source) //at java.util.Scanner.nextDouble(Unknown Source) //at TestC.getBusinessInfo(TestC.java:50) //at TestC.main(TestC.java:29) any help is very much appreciated

Member Avatar for stultuske
0
204
Member Avatar for piso_mojado

running into an issue haven't seen this before where content during the encoding and decoding of an image looses byte count. I have an app taking the photo image and sending the file via: ----------------------- byte[] imageBytes = new byte[(int) imageFile.length()]; inputFile = new RandomAccessFile(imageFile, "r"); inputFile.read(imageBytes); String base64String = …

0
180
Member Avatar for ascyndance6y

I've been planning a certain program for 3 years. During these 3 years, I've let thoughts and ideas formulate, and stew, in order for me to critique them properly. I know precisely what I want this program to do. For almost every function I know what as a client I …

Member Avatar for ascyndance6y
0
375
Member Avatar for FUTURECompEng

Review for a final and I had a question... You are give a hash function h(x) = x%11 and the size of the hash table is 11. The inputs are 4371,1323,6173,4199,4344,9679,1989. What would the resulting hash table be using quadratic probing. Would I start with 4371 and then do the …

Member Avatar for FUTURECompEng
0
240
Member Avatar for ibthevivin

So this is basically what's supposed to be the outcome of my code: > 69:hw/05/src> javac WordOccurrenceCounter.java 70:hw/05/src> java WordOccurrenceCounter Reading the book... Getting counts from a TreeMap... Enter a string ('q' to quit): wealth wealth occurred 7 times. Enter a string ('q' to quit): poverty poverty occurred 10 times. …

Member Avatar for Taywin
0
248
Member Avatar for ruchi18

Hi, I have a jsp file which call java class file function passing connection as a parameter all was working fine once but when i changed few code in java file and compli it complied successfully but jsp file still giving previous class function output. I am working on amezon …

Member Avatar for ruchi18
0
183
Member Avatar for london-G

Hello, I am supposed to write recursive program. I have done this below, however I don't know if my understanding of recursion is correct. I believe that it is a method which calls this method inside. In my case (insertCommas). private String insertCommas(String str) { if(str.length() < 4){ return str; …

Member Avatar for Taywin
0
110
Member Avatar for xThrash

Hello, For an assignment I have to implement some search algorithms in order to solve the travelling salesman problem, I understand the problem and I understand how the algorithm works, I simply don't know how to implement it (my Java isn't great) but this should really be the easy part …

Member Avatar for Taywin
0
277
Member Avatar for binaryjc

Hello Internet. So the task is to create our own parser for a expression calculator. For Example: Input: 3+2*1-6/3 Output: 3 Input: 3++2 Output: Invalid Expression Input: -5+2 Output: -3 Input: 5--2 Output: 7 The code [Here](http://www.technical-recipes.com/2011/a-mathematical-expression-parser-in-java/) solves a part of the problem except that it has a fixed input …

Member Avatar for Taywin
0
5K
Member Avatar for RLS0812_1

I have ran into an issue when programming a plugin that is dependent on another plugin. The plugin in question has 3 different versions, all of them are incomparable with each other. Instead of writing 3 separate plugins, I would like to know which .jar file exists, and import the …

Member Avatar for RLS0812_1
0
307
Member Avatar for rahulrulez

Hello, I've created a Button in one form. I've to make it work like, if I click on that button it should open another JFrame Form or JPanel form which I've created as addStock.java.. I don't know how to trigger this action.. Anyone can help me? Regards, Rahul.

Member Avatar for stultuske
0
1K
Member Avatar for manaila

I am trying to test [this](http://www.tutorialspoint.com/jsp/jsp_java_beans.htm) code but unfortunately I get `Can't find a method to write property 'age' of type 'int' in a bean of type 'test.StudentsBean'` error. But when I change age type to String and also its getter and setter methods it works well. Can anybody tell …

Member Avatar for manaila
0
101
Member Avatar for ofir.attia.7

I have a list of sizes ( for example : 3X1 , 4X2 and so on..) i want to check if i can put all of them in one matrix. i need to do it in a recursive way. the function I need to write is a function that get …

Member Avatar for ofir.attia.7
0
317
Member Avatar for ozman26

Hello All I have an issue. created 2 java programs, a.java and b.java content of a.java: package test; import test1.*; publuc class ATEST { public static void main (String[] args) { BTEST.call(); } } content of b.java: package test1; public class BTEST { string name; void call() { . . …

Member Avatar for JamesCherrill
0
201
Member Avatar for amvnwguy

Hey, I'm new to this site and asking for help in general, but this prompt my teacher gave us to do makes no sense to me at all. I dont know if he is asking us to input values manually from the keyboard into the 2 dimensional array or if …

Member Avatar for stultuske
0
114
Member Avatar for java123456

hey guys , I don't understand why the outPUT is that for the code below.. can someone please explin me how it works. Thank you. class example{ public static void main (String[]args){ int i = 1,j; while (i<=3){ j=i; while(j<=4){ System.out.println(j+" "+i); j=j+2; } i=i+1; } } } HERE IS …

Member Avatar for maurice91
0
161
Member Avatar for viona.diminarthi

hei, please help me. I have a project sales .. in the form of sales transactions I would add an update on caret functions texfield subtotal. caretupdate function I use to buy goods at more than one then it will be totaled automatically which will go on with new texfield …

Member Avatar for stultuske
0
371
Member Avatar for caierhui

import java.awt.event.ActionListener; import javax.swing.JFrame; //This Java Program determines the weighted average //of four test scores. //import statements for the needed packages public class Assign1 extends JFrame { //declare JLabel variables as reference to label components //declare JTextField variables as reference to input/output text boxes //declare JButton variables as reference to …

Member Avatar for love1969
0
207
Member Avatar for Kronolynx

I'm trying to write an applet with menus but is not working I'm getting these errors: load: MenuFrame$AppletMenu.class can't be instantiated. java.lang.InstantiationException: MenuFrame$AppletMenu at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) could some one please explain me what is wrong. …

Member Avatar for Kronolynx
0
132

The End.