32,199 Topics

Member Avatar for
Member Avatar for sk8ergirl

how can I find mode in java using arrays, if statement or for loop I have another question I want to ask the user to input number and then draw triangle like this [url]http://www.thebestdata.com/FileArchieve/2434_File1_1.PNG[/url] how can I do this

Member Avatar for sk8ergirl
0
337
Member Avatar for musikluver4

I have been doing java for almost 3 years now, am just starting to learn Objective-C as of this past June. Been writing a few programs on my own and writing programs for the exercises in 2 very cool Cocoa/objective-c books. My question is how do I, coming from Java, …

Member Avatar for anilkumar-m
0
266
Member Avatar for siddiqui_1985

hi everyone, as title said all, i need actually to find a vowel(a,e,i,o,u) in a string. it counts how many vowels are in the string that's fine but i need to find a vowel too.. any idea how to achieve this ? [code]import java.io.*; import java.lang.*; public class VowelsExample { …

Member Avatar for stultuske
0
714
Member Avatar for mike2828

my program works fine but i dont know why when i debug the program the shapes are coming out without me pressing the buttons [CODE]import java.applet.*; import java.awt.*; import java.awt.event.*; public class AnAppletWithButtons extends Applet implements ActionListener { Button button1, button2; int r, g , b; Color color; boolean drawLine …

Member Avatar for mKorbel
0
145
Member Avatar for ckwolfe

Hello I have a simple issue that is not a compilation or runtime issue, but an aesthetic problem that I can't find a function for. Basically I've created a GUI window that visually represents a game board for my Reversi gameboard. I've implemented the GUI and the Reversi gameplay and …

Member Avatar for mKorbel
0
6K
Member Avatar for greatcornholio

Hi all, Im new to java, and im working with j lists importing data from sql server. Thing is that i can import the data from the sql tables, but for some reason it does not refresh properly. Thing is that when the frame is opened the list is filled …

Member Avatar for mKorbel
0
239
Member Avatar for StephNicolaou

Hey guys, I've drawn a grid, and I have a label contatining a picture. Whenever I change the location of this label, the grid dissapears until I resize/move the frame. Any suggestions on best method to buffer these grid lines? They aren't going to be moving graphics or anything like …

Member Avatar for StephNicolaou
0
152
Member Avatar for Lendaanx

Need help getting my add, save, search, modify, delete buttons to work I can get them to show up in the GUI but pressing them does nothing. I need the save button to save file to index.dat in folder c:\\data\ folder and create that folder if it doesn't exist [CODE]import …

Member Avatar for JamesCherrill
0
155
Member Avatar for amture101

hey guys, I'm making a small app that make a Jable and saves the table model then loads the table model and set it to the table interface and both saving and loading is in seperate frames. [CODE] // Saving the info String ufname = Fname.getText(); String ulname = Lname.getText(); …

Member Avatar for amture101
0
128
Member Avatar for subone

Hi I have this problem where I tell the user to prompt 10 integers separated with spaces. And then I have to output the same numbers the user entered and then output max and min numbers. So How can I get the maximum value of these multiple integers? This is …

Member Avatar for JeffGrigg
0
258
Member Avatar for kelvin924

The user input four integer numbers in same line,for example,4857 After the input, I would like to place the four numbers into array The result ,array[i] = j i is the position , j is number of input. how to do it? must require to use substring? any other solutions?

Member Avatar for hiddepolen
0
95
Member Avatar for overrated

I need help with incrementing my score. I tried ++wins..., wins++..., wins += 1..., wins = wins + 1... and so far nothing works. I just keep getting 0. My main class: import java.util.Scanner; public class Test { public static void main (String [] args) { Rock game = new …

Member Avatar for JamesCherrill
0
119
Member Avatar for pikalife

What should I write within a while loop that allows me to keep on divding a number by 2 until it meets certain conditions. for example while(condition) { //what should i write here to have a double that divides by 2 until it meets the condition. }

Member Avatar for JamesCherrill
0
159
Member Avatar for StephNicolaou

Hey guys, I've constructed the main class to refer to a variable in it and I receive a stack overflow error. Any suggestions on the causes of this error, I've used this method previously and have not got this before. [code] In other class: MainClass class = new MainClass(); errors: …

Member Avatar for JamesCherrill
0
204
Member Avatar for lele07060

I tried to compile the program and I got these two errors and I do not know what they mean. (Lab4 is the name of my program by the way) Lab4.java:22: incompatible types found : java.lang.String required: double double fedwithHolding = "FedTax * GrossPay"; Lab4.java:26: incompatible types found : java.lang.String …

Member Avatar for hiddepolen
0
147
Member Avatar for cecsFTL

In this project I'm suppose to use a old project and create a menu for it. Basically "Create a menu system so that the user may choose between the various Roach functions (create roach colonies, breed and spray roaches and get the current number of roaches). Make sure you display …

Member Avatar for cecsFTL
0
381
Member Avatar for plasticfood

my program includes pictures and audio, do i have add that to my project and then create a jar file? or i just have to include the source file and that's it?

Member Avatar for plasticfood
0
176
Member Avatar for ttamilvanan81

Hai i have using the checkbox in for loop. I need the urgent help from anyone, for example in the loop there is having 5 checkbox if i checked 3 of the ckeckboxes and 2 of the checkboxes are unchecked. I need to get the values for checked checkboxes and …

Member Avatar for stultuske
0
537
Member Avatar for hannah shrn j

[code]class node { public int data; public node LC,RC; public int shortest; } class minleftist { node root = null; public void insert() { int newelt=0; try { System.out.println("Enter the element:"); DataInputStream din=new DataInputStream(System.in); newelt=Integer.parseInt(din.readLine()); } catch(Exception e){} node temp = new node(); temp.data=newelt; temp.LC=temp.RC=null; temp.shortest=1; if(root==null) root=temp; else root=melt(root,temp); …

Member Avatar for JeffGrigg
-1
258
Member Avatar for StephNicolaou

Hey guys, I'm drawing a grid using the nested for loop with draw line method. Any tips on getting this in the center of my screen? I am currently using the getWidth and getHeight methods of my center panel but it is still drawing in the top left corner. It's …

Member Avatar for StephNicolaou
0
241
Member Avatar for TigerTeck

[CODE]public class Card { public Card(String cardValue) { input = cardValue; } public String getDescription() { if (input.length() == 2) { if(input.substring(0,1).equals("A")) first = "Ace of "; else if(input.substring(0,1).equals("2")) first = "Two of "; else if(input.substring(0,1).equals("3")) first = "Three of "; else if(input.substring(0,1).equals("4")) first = "Four of "; else if(input.substring(0,1).equals("5")) …

Member Avatar for TigerTeck
0
305
Member Avatar for chiiqui

I just wanted to know what famous algorithms that you should have in hand? or be familiar with? or That is always used?

Member Avatar for JeffGrigg
0
234
Member Avatar for rotten69

[CODE]public static void main(String [] args){ ArrayList<String> list1 = new ArrayList<String>(); list1.add("ABC"); list1.add("123"); ArrayList<String> list2 = method(list1); list2.add("ABC"); list1.add("123"); System.out.println(list1); System.out.println(list2); } private static ArrayList<String> method(ArrayList<String> list) { ArrayList<String> result = list; result.remove("123"); return result; }[/CODE] Could anyone explain this code to me? why it gives me the same result …

Member Avatar for JamesCherrill
0
190
Member Avatar for vidhya33

Hi.. I need a java program to find out the bandwidth in LAN.. Please help me in solving out this problem soon... Thanks in advance..

Member Avatar for JamesCherrill
0
97
Member Avatar for Stjerne

Hello guys, Sorry for the title, it should be Renting bicycle program XD Can't edit XD I've got a task from my school. I've to create a new computer system for Oslo City bikes. The Oslo City Cycle bike racks at various locations around Oslo where people with valid bike …

Member Avatar for Stjerne
0
826
Member Avatar for StephNicolaou
Member Avatar for hayden11

Please help. I ask the users to give me a char (either X or O), but when the users play the game, all they see are squares. Thanks!! [CODE]//game class import java.util.Scanner; public class Game { Player player1; Player player2; Board gameBoard; public Game() { player1 = new Player(); player2 …

Member Avatar for hayden11
0
435
Member Avatar for lele07060

Hello everyone, I am new to this java programming and wanted to know if anyone could solve this problem for me. I would greatly appreciate it. Thank you! "Write a program that asks the user for 2 integers a and b, the program displays their sum, difference, product, quotient a/b, …

Member Avatar for JeffGrigg
0
3K
Member Avatar for lbgladson

I have an assignment to create a class Input and have method public static int readInt(Scanner in, String prompt, String error, int min, int max) I was provided the main method but have no idea what I'm supposed to be putting in the class Input. This is what I have: …

Member Avatar for stultuske
0
167
Member Avatar for looklikeasfine

Write a program that computes the average and standard deviation of the text floating point numbers in a file. Use the following formulas for the average and the standard deviation of N values. The formulas compute the sum, the sum of squares, the average, the average square, the variance, and …

Member Avatar for stultuske
0
111

The End.