32,199 Topics

Member Avatar for
Member Avatar for jt_4285

i am newbie to java.i am trying to run a program to show "static method" and "static variable ".my code is below.i am compling it on netbeans 7.01 and everytime i am getting the error.: "main method not found in class static_demo.Static_demo, please define the main method as: public static …

Member Avatar for stultuske
0
243
Member Avatar for applejax77

I am working on a nested control structure program that will, when user imputs any letter, whether it be upper or lower case will count the number of times the letter appears in the sentence entered by the user. In the code below when the user enters lower case letter …

Member Avatar for DavidKroukamp
0
145
Member Avatar for amture101

well I'm trying [CODE] String filename = "table.file"; JTable table = new JTable(elements, header); TableModel tm = table.getModel(); try { FileOutputStream fos = new FileOutputStream(filename); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(tm); oos.flush(); oos.close(); } catch (IOException e) { e.printStackTrace(); return; }[/CODE] but it only delete the old entry and write …

Member Avatar for DavidKroukamp
0
5K
Member Avatar for sidereal

Hey guys!!! I know these simulations are too much but.... still another one and I am havin some problems with that/// I have to create a file system simulation that has to understand these commands: cr a - create a new file named a, size ==0; rm a - remove …

Member Avatar for MastAvalons
0
429
Member Avatar for applejax77

Can someone please help me find what is wrong with my code below. The program is suppose to add all the input numbers except for the sentinel which is -1. What am i doing wrong? import java.util.*; public class InClassWork { static Scanner console = new Scanner(System.in); public static void …

Member Avatar for applejax77
0
158
Member Avatar for s.w.a

hello every body, how are you all please i want some one to help me in my prgram this ,as i think, is the piece where the problem occur, the output is being to give only the last value i enter from the keboard where me need is to insert …

Member Avatar for NormR1
0
146
Member Avatar for wallet123

whats the error in here? everytime i run this program even though there are no red underlines and signs still, it say theres an error in here ... and how can i do the same program using if else statement? i have started doing if else but my program its …

Member Avatar for wallet123
0
188
Member Avatar for ajacintha

Hi, I am creating a tool where a user takes a screen shot of the users report and paste all in a word document. I am working on a tool which automates this, im my application the user click snapShot button on the screen where the snapshot is to taken, …

Member Avatar for NormR1
0
413
Member Avatar for ajacintha

I have create a JFrame for my Login Screen. I need my JFrame to be Non Draggable. I tried the setUndecorated method. It makes the Jframe Non-Draggable. But I am not able to view the border of the Jframe and also the minimise, close buttons. So what is the alternative …

Member Avatar for ajacintha
0
88
Member Avatar for caswimmer2011

Hey. I am trying to make a "virus" that will not let the user exit the program even with pressing Command+Q (oh, ya, I have an Apple). Here is what I have so far: if (keylistener.getKeyCode()==81){ System.out.println("Works"); } I have the println just to see if it works (which it …

Member Avatar for peter_budo
0
141
Member Avatar for Armanious

My objective is actually [B]extremely[/B] simple, but I just don't know how to do it. I want to put some swing components on top of graphics which fills the entire screen. That's it. And I can't figure out how to do it... Some other side-questions that I would love to …

Member Avatar for Armanious
0
211
Member Avatar for divsok

i have Register page and Login page.And for save usernames and passwords i used arraylists in a servlet.how can i forward these arraylists to another servlet for validate username and passwords..?

Member Avatar for divsok
0
167
Member Avatar for agrzesiak

So i have a problem that reads: Each line of the file consists of a student’s name followed by an unpredictable number of test scores. The number of students is also unpredictable. The desired output is as shown where the numbers there represent the average test score rounded to the …

Member Avatar for agrzesiak
0
4K
Member Avatar for LondonJava

I have configuration properties implemented as a java.util.Properties Object with the mappings saved in a config.properties file. I have managed to update the properties in a user input panel, so the user can change any settings while the application is live. However I want any changes a user makes to …

Member Avatar for LondonJava
0
221
Member Avatar for Priyanka8989

Hello, I am a student.For the project we have to store first 20 search engine results (URLS and id) in the Mysql database.We referred to the google search API ,it says we will get results in JSOn/ATOM format.But we are not getting exactly how to store those results in JSON …

Member Avatar for dmanw100
0
174
Member Avatar for wallet123

if u will try to run this, while looking at the codes ull know my mistake, the thing here is when i choose "b" it will show the balance, the a question like this will open up: "Would you like to generate bank slip?" if yes it should go in …

Member Avatar for hfx642
0
151
Member Avatar for jot121

[CODE] public static Integer[] getTopThree(Integer[] values) { int max1 = Integer.MIN_VALUE; int max2 = Integer.MIN_VALUE; int max3 = Integer.MIN_VALUE; //assuming integer elements in the array for (int i = 0; i < values.length; i++) { if (values[i] > max1) { max3 = max2; max2 = max1; max1 = values[i]; } …

Member Avatar for hfx642
0
134
Member Avatar for nickmi

Good afternoon Well my idea is simple.What i want to do is to create a currency converter.Pretty easy task, but i want the currency rate to be updated somehow by an external server, probably from an website.Although i have experience in programming i have no clue how to use an …

Member Avatar for hfx642
0
209
Member Avatar for Ashenvale

[CODE] for (ctr = 0; ctr<cost.length; ctr++) { cost[ctr] = price[ctr] * qty[ctr]; totalCost = totalCost + cost[ctr]; aveCost = totalCost / cost.length; } System.out.printf("Average Cost: %.2f\n\n", aveCost); [/CODE] with this code the output will be, for example: [QUOTE]Average Cost: 15900.00[/QUOTE] I want my output to look like this [QUOTE]Average …

Member Avatar for NormR1
0
98
Member Avatar for Ashenvale

I'm suppose to follow this algorithm: 1. Declare all ordinary Variables 2. Prepare and initialize all arrays. 3. Prepare array to hold all item cost. 4. Initialize Array cost with 0.(using for()statement) 5. Compute cost of each item then store results to array cost.(using for()statement) 6. compute average cost(using for()statement) …

Member Avatar for Ashenvale
0
122
Member Avatar for enterpise

Actually i try to create a method which can call the scanner keyboard firstly i was trying this void makeRequest(){ request ="Hello"; } So i wanna make like when i call this method it will tell me to input the String by scanning the keyboard is it possible to do …

Member Avatar for enterpise
0
142
Member Avatar for wallet123

why is that some of the codes that i put in are not being implemented when i run this?? i mea, the cycle of my program doesnt seem to be flowing the way i want it to be, come take a look :( [CODE] { /** * @param args */ …

Member Avatar for stultuske
0
125
Member Avatar for Daigan

I can't figure out what the error is. [CODE]public void quizTest () { c = new Console(); int total = 34; String[] quizArray = new String [total]; String quizQuestions; int i = 0; int u = 0; try { FileReader readQuestion = new FileReader ("QuizQuestions1.txt"); BufferedReader buffReadQuestion = new BufferedReader …

Member Avatar for Daigan
0
87
Member Avatar for wallet123

i dont know that my error is, my code for balance is not working properly and im having a problem with my if else statements, they say i lack this "{" but i dont know where to put it [CODE] { /** * @param args */ public static void main(String[] …

Member Avatar for mcriscolo
0
175
Member Avatar for Daigan

Are there like 3d pushable buttons in Java? I want to put 3 buttons on top of each other, is that posible? I found JButton and I don't think I can do it with that?

Member Avatar for Daigan
0
121
Member Avatar for sirlink99

When I run my code, and advance from level to level it works correctly, but when I would like to restart my program I cannot get the frame to reset. Here is my code [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Frame implements KeyListener{ GraphicsDevice vc; Player p …

Member Avatar for sirlink99
0
141
Member Avatar for Warl30ck

Hello, fellow programmers. Today I encountered a problem getting the 2d array length. By this I mean How many x values are filled, that all the x's sub values are filled {y}. ex x-> 1, 2, 3 ,4, 5, 6 y 1, 1, 1 | 2, 2, 2 3, 3, …

Member Avatar for Warl30ck
0
161
Member Avatar for dennysimon

Hi all I tried todo javac command on two classes (one after another) the problem is when I javac the first it gives me error ,because class of the second not already exist,the same happen when i javac the second ,class of the first also not already exist. how to …

Member Avatar for dmanw100
0
111
Member Avatar for behemothdave

My assignment is as follows: Create aJApplet that contains twoJTextFields, aJButton, and threeJLabels. When the user types an employee’ s first and last names (separated by a space) in a JTextField, the employee ’ s job title is displayed in a secondJTextField. Include two JLabels to describe theJTextFields used for …

Member Avatar for NormR1
0
515
Member Avatar for laklaker

So hello everyone! This is my school project but I'm having a problem in my code. So here is the program i want to create. I want to create a program that can generate 5 numbers from 1-9 then user will guess it. My problem only is on the generating …

Member Avatar for DavidKroukamp
0
235

The End.