32,199 Topics
| |
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 … | |
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 … | |
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] | |
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 … | |
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 | |
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 … | |
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 … | |
[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 … | |
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" … | |
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 … | |
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. … | |
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 … | |
[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 … | |
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 … | |
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 … | |
how to create a submenu in Swing. I am using Netbeans IDE 6.8. Please help me. thanks in advance | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 () | |
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 { … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … |
The End.