32,199 Topics

Member Avatar for
Member Avatar for PuQimX

i want to add condition if >100 is error but when im try to add the condition the program is running but not what i want... can somebody tell me what should i do..tq import java.util.*; public class test_scores { public static void main(String args[]) { Scanner input = new …

Member Avatar for tjsail
0
208
Member Avatar for bd338

Hello everyone! I'm currently making my own implementation of java.util.List, and it's going pretty well. I've just run into a minor problem. I'm currently doing the 'addAll(int index, Collection<?> c);' method. But I can't seem to figure out how to make it start at the specified index.. this is the …

Member Avatar for ~s.o.s~
0
1K
Member Avatar for Dasau

Hi I would like to know what operator to use for a number in between my input. Is it something like this? If I input the number between 116 and 200. [CODE]else if (Earn>=116)&&(Earn <=200)[/CODE]

Member Avatar for stultuske
0
64
Member Avatar for xlx

hi there i wanted to know if there is something like global or extern variables (in,c language),which i can use in every class ?! and my other question is ,if is there a complete tutorial on netbeans gui builder , because i have lots of problems about jframes. thanks a …

Member Avatar for xlx2
0
101
Member Avatar for jemz

hello please help me i have picture then i want to put on my JButton but the problem is that my picture is too big its jpg file how to make this bmp file so that it fit to my Jbutton..hoping for your positive responds

Member Avatar for jemz
0
183
Member Avatar for Clawsy

Hi, I have a pixel array grabbed with [I]PixelGrabber[/I]. I done some computation with it and now I need make a BufferedImage from it. The problem is I can't make it very fast, just slow. I made an Image type object from it then I converted it to a BufferedImages …

Member Avatar for JamesCherrill
0
2K
Member Avatar for rakshavprabhu

Hi I am a novice working with Java and the eclipse IDE. What I want to read words from a text file, store it as a list converting it to some uniform case. Then I input some word/sentence from keyboard and check whether it is present in the file. Well …

Member Avatar for rakshavprabhu
0
107
Member Avatar for ontherocks

[B]Input file[/B] --> input.txt (contains the lines below) --------------------------------------------- 1. Something something 2. Something something 3. Something something 4. Something something 5. Something something --------------------------------------------- [B]Requirement:[/B] Read the text file line by line and compare a character in the current line with all the lines below it. For example if …

Member Avatar for BestJewSinceJC
0
1K
Member Avatar for topest1

Hi all, I have extended JButton to myButton this is my constructor [CODE]myButton(String text,char key){ this(text); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(Character.toUpperCase(key)),"Action"); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(Character.toLowerCase(key)),"Action"); this.getActionMap().put("Action",action); this.setMnemonic((int) Character.toUpperCase(key)); }[/CODE] I m using single key shortcut for the myButton and i am using setToolTipText(String) But when i hover it shows me like this "Move Tool Unknown KeyCode: 0x0" …

1
67
Member Avatar for cchrisgates

I'm writing objects in a link list to file and when I write more thatn a certain number I get a StackOverflowError. My list has Item objects which have long part numbers, two doubles, a string, and an int. here's the code that is failing; [CODE] try { FileOutputStream fos …

Member Avatar for javaAddict
0
108
Member Avatar for fowlergod09

Hi i am very new to java and have come across this problem in my code. Will someone please explain to me why i am getting a null point exception and what one is? I have tried to find out what it means but i cannot find an explanation anywhere. …

Member Avatar for javaAddict
0
417
Member Avatar for doha786

hi, I am trying to build a small program that can search java ‘class’ files and ‘method’s from a repository where millions of java files are stored. In addition it has an algorithm(LONGEST COMMON SUBSEQUENCE) to compare the results to find the similarity percentage and user can make precision by …

0
77
Member Avatar for s4rddy

[B]Hi, Please could someone help with the following, I am a beginner at Java :) Thanks[/B] There is a rhyme (a bit like 'Ten Green Bottles' ) called 'Bottles of Beer' which runs thus: 4 bottles of beer on the wall, 4 bottles of beer, Take one down, pass it …

Member Avatar for Grn Xtrm
0
102
Member Avatar for kaushalya_uom

I'm given a project to develop program to search text files in a folder to find matches for a given text and list the containing files. I can't use Java built-in data structures. I have to use my own data structures with algorithms. I thought of building a data-structure similar …

Member Avatar for javaAddict
0
130
Member Avatar for Moonrise_state

Hi, I wrote a python program that counts the occurance of each alphabetic character in a string and it works fine. I tried to port it over to java but now it fails, telling me that there is no alphabetic characters at all in it. [CODE]for (int i=0;i<alphabet.length;i++) { for …

Member Avatar for musthafa.aj
0
115
Member Avatar for gayathrigmenon

how to create a submenu in Swing. I am using Netbeans IDE 6.8. Please help me. thanks in advance

0
47
Member Avatar for CheekyB

Following examples and threads of previous inquiries I find myself asking two primary things 1. Why when I place the following code - [CODE]Break;//break the string[/CODE] at the end of my while statement that reads [CODE]while(!name.toLowerCase().equals("stop")); //begin while control statement end = true; //end if condition is true, counter initiated …

Member Avatar for BestJewSinceJC
0
80
Member Avatar for OffbeatPatriot

I have a class, Cast(as in cast of a play), that implements the Collection<Actor> interface(Actor is a class representing an entity in a game) and I have the following code. [code=java] Set<Actor> toRemove = new HashSet(locations.keySet()); //method 1 toRemove.removeAll(actors); //method 2 for(Actor actor : actors){ toRemove.remove(actor); } [/code] if I …

Member Avatar for OffbeatPatriot
0
134
Member Avatar for JainishP

I have an assignment where I am supposed to get a user input file with data in it, like below: [QUOTE]Billy Bob 98.6 98.6 98.6 100 200 300 400 500 600 700 800 900 110 220 330 440 550 660 770 880 990 111 222 333 444 555 666 777 …

Member Avatar for verruckt24
0
164
Member Avatar for lightninghockey

I would like some help with this program that I wrote for my class project. I have a class Point, class Circle and a main test program. I'm having difficulty with where to put some if else statements to find the quadrant that the points x,y are located. I wrote …

Member Avatar for lightninghockey
0
1K
Member Avatar for manikandan_dani

Hi, How to edit the following xml file without losing elements. eg: [code=xml] <book id="b1"> <bookbegin id="bb1"> <para id="p1">This is<b>first</b>line</para> <para id="p2">This is<b>second</b>line</para> <para id="p3">This is<b>third</b>line</para> </bookbegin> </book>[/code] I try to edit the above xml file using dtd using jsp,servlet. but while i read the textvalue from xml, it return …

Member Avatar for manikandan_dani
0
130
Member Avatar for Ashwin Vasnai

If in big problem, I want a to add the ResultSet of MySQL in JTable.Table should in Panel. and There should be autosizing of the result.

Member Avatar for lanhlung696
0
359
Member Avatar for sunilkuntal

i am making a media player to play all types of media player using jmf technology. can anyone help me to figureout how jmf can play all files ()

Member Avatar for BestJewSinceJC
0
55
Member Avatar for PuQimX

i want the output detect the error because the condition is -20-20, 1st key in is ok but the second time no matter what number i have key in it will accept even i key in out of condition. please help me... import java.util.Scanner; import java.text.DecimalFormat; public class CPI { …

Member Avatar for BestJewSinceJC
0
140
Member Avatar for devilkhan

hay there hope you will all be fine I an idea about the product for that i need a software but i dont know that in which software it will be made my idea about the product is that "I want to make a product in which all the information …

Member Avatar for stultuske
0
62
Member Avatar for mark185

Why must the use of the this keyword, or similarly the use of the super keyword in constructor chaining, be on the first line of an overloaded constructor? In other words, actual class construction cannot be split between constructors. If re-direction must occur, it must be the first line of …

Member Avatar for mark185
0
137
Member Avatar for Gadgetman_53

Hi, I am new to Java, but have been programming in C++ for a few years now. I am working on a project where I have to write a class to implement a gameboard. To do so, I'm using a 2D array of objects. I have a method that swaps …

Member Avatar for Gadgetman_53
0
282
Member Avatar for soteri0s

I'm trying to compare strings in a Linked List and it throws a null pointer exception somewhere in the method smallest() which is where i have the strings(nodes) comparing each other. I've been Trying to find the answer for two days now and I've gotten nowhere. PLEASE HELP! The code …

0
211
Member Avatar for hafizullah

Hi, I am doing a final year project which is about predicting a situation based on given known facts, as a extra feature to my project I would like add a word cloud system to it aswell that would display the predictions in word cloud form to indicate the likelyhood. …

0
83
Member Avatar for Stefano Mtangoo

I plan to make Java image viewer I just started today and I had hard time with GridBagSizer After long time of pain it turned to be fruitful. Here is what I have so far. I want the following, of which I have failed: 1. Make the components fill the …

Member Avatar for Stefano Mtangoo
0
85

The End.