32,199 Topics

Member Avatar for
Member Avatar for long89

this my code import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Panel extends JPanel implements ActionListener{ private JTextField weight,height, answer; private JButton calc, clear, exit; public Panel(){ this.setLayout(new GridLayout(2,1)); JPanel topPanel = new JPanel(); topPanel.add(new JLabel("WEIGHT(KG)")); topPanel.add(weight = new JTextField(5)); topPanel.add(new JLabel("HEIGHT(M)")); topPanel.add(height = new JTextField(5)); topPanel.add(new JLabel("BMI")); topPanel.add(answer =new …

Member Avatar for mKorbel
0
222
Member Avatar for Beautifullove09
Member Avatar for mohamed moamen

How i can do a server that can be handle a very large number of clients (in same time) between 250,00 to 1,000,000 clients or more ? , Because when large number of clients connect to the normal server that failed.

Member Avatar for mohamed moamen
0
242
Member Avatar for Beautifullove09

Hi I"m receiving this on my program. I know that this happens when i choose a location outside of the map, but how do i fix this? Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at GameMap.getLocation(GameMap.java:56) [COLOR="red"]return map[xdimension][ydimension];[/COLOR] at Game.startGame(Game.java:87) [COLOR="Red"]System.out.println("New Location:" + mapMgr.getLocation(X,Y).getLocation() + ", "+ mapMgr.getLocation(X,Y).getDescription());[/COLOR] at Game.main(Game.java:168) [COLOR="red"] …

Member Avatar for NormR1
0
117
Member Avatar for wallet123

[CODE]public class Array { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String ctr=""; int size= Integer.parseInt(JOptionPane.showInputDialog("Enter any 10 numbers:")); String num[]= new String [11]; for (int i=1; i<=size;i++){ num[i]=JOptionPane.showInputDialog("num["+i+"];"); ctr=ctr+num[i]+ " "; } JOptionPane.showMessageDialog(null, ctr); } } [/CODE] thats my code, …

Member Avatar for wallet123
0
1K
Member Avatar for Syrne

Hi there, I wrote a VERY simply program attempting to use a recursive function to calculate a math problem and spit it out onto a table. It prints once and then I'm getting a stack oveflow error on line 8 and then line 12: [CODE] package recurtable; import java.text.*; public …

Member Avatar for Syrne
0
125
Member Avatar for Hypnos_16

I'm making a maze game for a project in school, and as such i need to create boundaries for the game. not only for the outer walls but also inner ones of different and sometimes not perfect squares. I was just wondering how i should go about doing this? Is …

Member Avatar for NormR1
0
212
Member Avatar for sahmeme

the error goes like this: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order (custNo, dateOrder, totalPayable) VALUES ('', '2012/Feb/19 16:09:02', '0' at line 1 // HELP T_T. this project is to …

Member Avatar for harinath_2007
0
295
Member Avatar for TIM_M_91

Hi there guys can someone explain to me how I can increment a value within a field in my database each time I execute my query?. As I cannot seem to find a way to do this. Below is my structure for reading + writting to my database if you …

Member Avatar for TIM_M_91
0
174
Member Avatar for Valiantangel

Suppose that the tuition for a university is $ 10,000 this year and increases 5% every year. Write a program that uses a loop to compute the tuition in ten years. Write another program that computes the total cost of four years worth of tuition starting 18years from now. I …

Member Avatar for hfx642
0
123
Member Avatar for ilovejava

I have a question why is important to supress warnings in java, i notice my professor do that all the time [CODE] @SuppressWarnings("unchecked") [/CODE]

Member Avatar for rubberman
0
111
Member Avatar for Dhanesh10

Here is my java connectivity code to Oracle [CODE]public class OracleConnectivity { public Connection con; public Connection getConnection () { try { Class.forName("oracle.jdbc.driver.OracleDriver"); con=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:dhanesh","dhanesh","root"); Statement s=con.createStatement(); s.executeUpdate("insert into test (num,txt) values (2,'hi')"); s.close(); con.close(); } catch(Exception e) { System.out.println("Connection failed"); e.printStackTrace(); } return con; } public static void main(String[] args) …

Member Avatar for database_nitesh
0
448
Member Avatar for jackbauer24

Here is my code:- [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wrie.and.read; /** * * @author Administrator */ import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.*; import javax.swing.*; public class WrieAndRead { JFrame frame; JTextField field; /** …

Member Avatar for jackbauer24
0
170
Member Avatar for aliasadsahu

[CODE]class Animal { private String type; Animal theAnimal = null; // Declare a variable of type Animal public Animal(String aType) { type = new String(aType); } public String toString() { return "This is a " + type; } } class Dog extends Animal{ private String name; // Name of a …

Member Avatar for JamesCherrill
0
122
Member Avatar for capella2

I have been working on this topic for three days. I can not seem to solve the problem. I need to generate tree when the user enter binary with the corresponding variable the tree should be generated recursive until a certain condition is met. This topic is new to me. …

Member Avatar for NormR1
0
258
Member Avatar for chieny

DEPOSIT and WITHDRAWAL ERROR MESSAGE: Input Amount:Exception in thread "main" java.lang.NullPointerException at Soft_eng.ATM.main(ATM.java:226) there is a logic error or whatever error in deposit and withdrawal. :( there is a little problem in new account. when the system reaches 11 records it cause to force shutdown of this atm system. [CODE] …

Member Avatar for NormR1
0
544
Member Avatar for nered

Hi, So i got pretty far whit Java i covered basic operation, GUI w/e MVC design etc. It been a fun year learning Java. Now i want to make an application for communication between two points similar to a TFTP Server/Client. So this is how i visioned this to go: …

Member Avatar for JamesCherrill
0
426
Member Avatar for justindill

If I close off the for loop it works but I need to get the output to show as a dialog box as well. I need the output to show inside a dialog box: Output should include count of numbers entered the sum of the numbers the average of the …

Member Avatar for NormR1
0
889
Member Avatar for ali.jay110

Hi There is something about this code that does not seem right has anyone got any ideas? It does not matter what it does. I mean from a constructor/inheritance point of view. Some of the points I made were one constructor was passing a null value, which in turn was …

Member Avatar for ali.jay110
0
339
Member Avatar for angryKitten

Hi, I'm trying to learn some Java for fun and got a question about comparing integers. If I wish to compare int a to int b and check for equality that's pretty straightforward and easy, but if I want a method to return equal for different values I get a …

Member Avatar for JamesCherrill
0
135
Member Avatar for v3ga

My objective is to implement a GUI calculator in java. I am thinking of passing the expression entered by the user to bc and then get output from terminal and print to user. My question is [LIST=1] [*]How to execute a terminal command from java so that i can pass …

Member Avatar for v3ga
0
355
Member Avatar for ShaRp codeR

Hello, I would like to know any information about "UML Diagram Generator" from the code or if there is any good software which can enable me to make quick UML Diagrams from the code for my University Assignments. I have been looking for one but did not find anything good. …

Member Avatar for ShaRp codeR
0
341
Member Avatar for mags11

I am trying to get the program's decimal to output in two decimal places after the decimal. Please advise. [CODE] // MilesPerGallon.java // Program designed by XY import javax.swing.JOptionPane; // Needed for JOptionPane. import java.text.DecimalFormat; // Keeping proper decimal format. public class MilesPerGallon { public static void main(String args[]) { …

Member Avatar for mags11
0
2K
Member Avatar for long89

I don't know how to write code to exit for this program.someone please help me :( [CODE] import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Panel extends JPanel implements ActionListener{ private JTextField height, weight, answer; private JButton calc, clear, exit; public Panel(){ this.setLayout(new GridLayout(2,1)); JPanel topPanel = new JPanel(); topPanel.add(new …

Member Avatar for long89
0
207
Member Avatar for shifat96

Hello, I have a Computer Science project for school. I am done writing the full code but I am missing one of the requirements. Some of the text have to be aligned to the right. Here's an excerpt from my code which I want to change the alignment: [CODE] System.out.print …

Member Avatar for shifat96
0
903
Member Avatar for zina_a

hi, I have to make an application in java to access the switch of the my company and show his details(host name,IP adress,MAC adress,time fonctionnemnt...),also if any one tell me how can I make it,some samples in java abouth that would be helpful.

Member Avatar for zina_a
0
166
Member Avatar for jot121

here is the details I got: 1. Create a class called 'GuessMyNumber'. The constructor should chose a random number between 1 and 100. There should be a method 'guess(int guess)' that returns -1 if the guess is too low, 0 if the guess is correct, and 1 if the guess …

Member Avatar for NormR1
0
214
Member Avatar for RLS0812

It's going on 4 hours now, and I have yet to find an answer on how to do this. All I want to do access and manipulate data in a list, from another class. The 2 classes: [B]GetList.java[/B] [CODE]public class GetList { public static void main(String args[]) { MakeList xx …

Member Avatar for FALL3N
0
304
Member Avatar for TIM_M_91
Member Avatar for riahc3

Hey I want to use something like Dreamweaver to design a HTML page. (Excluding all the links to pictures and such) how do I get Java to get all that and convert it to a well designed PDF document like I was seeing in Dreamweaver? Thanks

Member Avatar for peter_budo
0
316

The End.