35,618 Topics

Member Avatar for
Member Avatar for 47pirates

My server is in python and I'm trying to read and write to socket using ObjectInput/Output Streams whenever i write to socket there is some characters written in socket before my writeObject() command is executed and whenever i tried to read the data from socket using readObject() , it gives …

Member Avatar for dantinkakkar
0
220
Member Avatar for drico7041

Hey, I created a phone directory program. But I was wondering if I could get some hints on how I could create a txt file and add, delete names and numbers on the txt file. [CODE]import java.util.*; import java.lang.*; import java.lang.Object; import jpb.*; public class PhoneDir { private static LinkedList …

Member Avatar for dantinkakkar
0
3K
Member Avatar for blake81

ChatBot class: A chatbot is a computer program designed to simulate an intelligent conversation with one or more humans. In this lab, we will establish the framework for our chatbot, which will be enhanced throughout the semester. The ChatBot class will define a name field that identifies the chatbot (name …

Member Avatar for dantinkakkar
0
491
Member Avatar for mohamed moamen

How i can make my server receive data from certain client and send it to other certain one ? (Note : there is a lot of clients connected with that server) , that's alike private chat between two clients .

Member Avatar for dantinkakkar
0
445
Member Avatar for shean1488

Here is the code for the programm. My question is why this statement in SudokuValidator doesn't work? [CODE]for (Cell[] myPuzzle : puzzle) {[/CODE] it gives me errors: [CODE] Exception in thread "main" java.lang.NullPointerException at SudokuValidator.isSolution(SudokuValidator.java:54) at SudokuValidator.main(SudokuValidator.java:27) [/CODE] [CODE]import java.util.*; public class Cell { int value; public Cell() {} // …

Member Avatar for stultuske
0
266
Member Avatar for adamb0mb

[CODE]import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Mortgage { private static double round(Double val) { // round the value to two decimal places int vala = (int) (val * 100); return (double) (vala / 100.00); } public static void main(String[] args) throws IOException { double loanAmount = 200000.00; // Loan …

Member Avatar for thines01
0
207
Member Avatar for Valiantangel

[ICODE]System.out.println("Extra credit\nRe-enter number of seconds:"); int j = input.nextInt(); int i =(j/60); int k = (j%60); System.out.println(j+" seconds is " +i+" minutes and "+k+" seconds.");[/ICODE] Hi when i key in 30 for j the correct answer should be [COLOR="Red"]30seconds is 0minutes and 0seconds.[/COLOR] However my above code gives me 30seconds …

Member Avatar for zeroliken
0
83
Member Avatar for cisumma

I am having trouble understanding how to set up the smtp property. I do not have internet connection now. I wanted to use my Outlook or something. What do I do to get Glassfish to generate emails so I can begin learning how to code my app to send emails …

Member Avatar for ztini
0
177
Member Avatar for Hussam Alahmadi

i can not understand my Home work plz help me this is the Question ...... Problem 1. Write a program in which you will do the follwing: 1. Declare a two-dimensional array of double with 12 rows and 30 columns to store daily temperatures for one year assuming each month …

Member Avatar for DavidKroukamp
-1
135
Member Avatar for riahc3

Hey I want to get the date and time with miliseconds in a format such as: 2012-02-09 12:41:52.982 or 2012-02-09 16:41:52.129 How can I do this in Java? (If I can get a localized version of "Tuesday" as "Tues" as well even better but if not, I dont mind. Something …

Member Avatar for riahc3
0
437
Member Avatar for HBK_100

[CODE] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: String sql="Select BADGE_NUMBER,FIRST_NAME from POLICE_TABLE"; try { Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance(); Connection con= (Connection) DriverManager.getConnection("jdbc:derby://localhost:1527/Traffic Ticket System","Administrator","admin1234"); /*As we are creating a connection on a local computer we will write the url as jdbc:mysql://localhost:3306 */ Statement stmt=con.createStatement(); ResultSet rs = …

Member Avatar for JamesCherrill
0
181
Member Avatar for Hussam Alahmadi

help me plz The program does not sum the elements of the 2 matrix this my code [CODE]package javaapplication143; import java.util.*; public class JavaApplication143 { public static void ReadMatrix(int [][]a1 ){ int val=0; Scanner input=new Scanner(System.in); System.out.println("Enter 3 rows and 3 Columns for matrix 1 "); for(int i=0 ; i …

Member Avatar for dantinkakkar
0
133
Member Avatar for shibu2all

Hello, Can anyone pls help me out with this code, its the server portion of the client server program..i have downloaded it from net [code=java] Socket s,s1,s2; ArrayList al=new ArrayList(); ArrayList al1=new ArrayList(); ArrayList al2=new ArrayList(); ArrayList alname=new ArrayList(); MyServer()throws IOException{ ServerSocket ss=new ServerSocket(10004); while(true){ s=ss.accept(); s1=ss.accept(); s2=ss.accept(); al.add(s); al1.add(s1); …

Member Avatar for dantinkakkar
0
185
Member Avatar for thefifthhjohn

in line 7 I have three errors. TextFieldOutputDemo.java:7 '.class' expected (where it points to 't' in "throws") FileOutputStream(String, boolean)throws FileNotFoundException; TextFieldOutputDemo.java:7 ';' expected (where it points to 't' in "throws") FileOutputStream(String, boolean)throws FileNotFoundException; TextFieldOutputDemo.java:7 not a statement (where it points to 'F' in "FileNotFoundException") FileOutputStream(String, boolean)throws FileNotFoundException; [CODE]import java.io.*; public …

Member Avatar for dantinkakkar
0
400
Member Avatar for RLS0812

I need to keep a string from resetting each time the class is called, but haven't found any good way of doing it ... Every time [B]if (block != LastC){}[/B] evaluates to true. ( which shouldn't happen very often ) [CODE] --- code snip --- public class Player_Move implements Listener …

Member Avatar for stultuske
0
143
Member Avatar for DEAD TERMINATOR

An assignment I'm working on requires me to write a method for the sole purpose of calling that method in a later method. As such I am required to write the first method to not display anything on screen and then I need to comment the calculation within the method. …

Member Avatar for stultuske
0
353
Member Avatar for wallet123

i was watching a tutorial about bubblesort, and i followed all the instructions the difference is that the tutor is using System.out while im using JOPtionPane, please help me thank you help me find my error and help me run it correctly! [CODE]public static void main(String[] args) { // TODO …

Member Avatar for rushikesh jadha
0
185
Member Avatar for hyperstars

After an hour of browsing the web, I decided to ask for help for my IB project (can't paste my whole code or I'll be cheating off myself). I don't have much experience, so please explain whatever syntax your solution may have (please don't say rewrite the whole thing). Anyway, …

Member Avatar for JamesCherrill
0
201
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
224
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
248
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
119
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
127
Member Avatar for turpentyne

If I have a loop of dropdowns that have the name "options[123]" where the bracketed number will change, is there a way to pull all the available dropdowns with a name that starts with "options" and then loop through them to make sure at least one is selected... <0

0
40
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
213
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
299
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
176
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
125
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
113

The End.