32,199 Topics

Member Avatar for
Member Avatar for Mbot

Hey, Im trying to write a chat program which should be able to run multiple clients using threads. But I seem to get this "java.io.StreamCorruptedException: invalid type code: 00" error the whole time. My server code: [CODE] import java.io.*; import java.net.*; public class Server{ ServerSocket serverSocket; Socket connection = null; …

Member Avatar for Qiqa
0
574
Member Avatar for nHulk

public class SendMessage { public static void main(String[] args) throws UnsupportedEncodingException { //String strMsg=java.net.URLEncoder.encode("This is API msg", "UTF-8"); callURL("https://api.mVaayoo.com/mvaayooapi/MessageCompose?user=user@gmail.com:1111&senderID=TEST SMS&receipientno=9999999999&dcs=0&msgtxt=msg&state=1"); } public static void callURL(String strURL){ System.out.println(" URL is :"+strURL); try{ URL obj = new URL(strURL); HttpURLConnection httpReq = (HttpURLConnection)obj.openConnection(); httpReq.setDoOutput(true); httpReq.setInstanceFollowRedirects(true); httpReq.setRequestMethod("GET"); String iStatus = httpReq.getResponseMessage(); System.out.println("iStatus: "+iStatus); } …

0
178
Member Avatar for yigit.hatipoglu

Hi everybody, I really tried to do my assignment but I am lost . Any helping is very helpful , Thanks Write a program that will generate a set of 50 random integers in the range -20 to + 20. The program should display the following: a) The number of …

Member Avatar for nmaillet
0
201
Member Avatar for gopi.mishra.7

Dear All, **Please first accept my humble respects unto all of you**. I am a masters pass out in computer science from a reputed university and I have pretty good knowledge of Java as i have studied and practiced first 6 chapters of Java OCJP by Bates(I am doing remaining …

0
43
Member Avatar for muhammads

Hi, I am new to java and am facing this problem. I have to use a TextEditor to display a list of customers. The JAR for that Texteditor which i have to use is available at (http://code.google.com/p/jtexteditor/downloads/list). Below is my class in which i am trying to use it. I …

Member Avatar for JamesCherrill
0
198
Member Avatar for muhammads

Hi All, I am not very good with Java and have a project in which i have to use this API ( http://code.google.com/p/jtexteditor/ ) to simply initiate/draw a TextEditor and fill it with the array of data i have. Unfortunatelly, there is no wiki/document/example with this API and i have …

Member Avatar for JamesCherrill
0
255
Member Avatar for greystreet34

Hi everyone, I'm in an entry level Java class and I'm supposed to be able to count the # of 7's within an integer. I've read the chapters and looked online for help but can't seem to figure it out. We just learned loops (do, while, for) and if statements …

Member Avatar for dmanw100
0
236
Member Avatar for ncis_sg1

**I am having trouble understanding exactly what I am supposed to do with the following instructions.** a. Create a class named Pay that includes variables of type double that hold rate of pay per hour and withholding rate percent. Gross pay is computed as hours worked times rate of pay …

Member Avatar for ncis_sg1
0
207
Member Avatar for ct_hunny

im trying to display result from my sql statement. here my report looks like success = 12 fail = 7 how can i display all success data when i click success and all fail data when i click fail link.. any idea..? im using netbeans...

Member Avatar for ObSys
0
76
Member Avatar for hwoarang69

i am make a 2d game in java. i have 3 class: Main.java, Player.java, Ground.java. problem i am having is how trying to make my player to jump. i want it so it jump fast, slow down at top, and come down fast on ground. so kind of like real …

Member Avatar for ObSys
0
289
Member Avatar for Syrne

Hi there, I'm attemtping to write my own version of the java "headSet" function which steps through a given tree set and returns all elements that are less than the function argument. For example: headSet(30) called for a set such as: [2, 5, 7, 18, 22, 34, 50, 76] should …

Member Avatar for Syrne
0
251
Member Avatar for emaellie

import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; class work { // main method constructs the Frame window public static void main ( String[] args ) { CircleWindow application = new CircleWindow(); }// end of main method }// end of Line app class CircleWindow extends Frame { private int nSeconds …

0
78
Member Avatar for bleedi

Hi, I've been searching all the internet for an answer for my problem, but none of the sites I've stumbled upon haven't given any results. So, I have a JList, held inside JSCrollPane, held inside JPanel inside JFrame. I have a MySQL database, and another block of code retrieves stuff …

Member Avatar for markzenz
0
2K
Member Avatar for shiv.hikumar

Display tag with strust2, tiles, export option to pdf, excel is not working in WAS7.Working perfectly in Jboss6.Below is error trace.

0
101
Member Avatar for rahul.ch

public class GenericDemo<E extends GenericDemo> { E innerE; public E doStuff(E e, GenericDemo<E> e2) { //insert code here } public E getE() { return innerE; } } The options are: 1. return e 2. return e2.getE() 3. return e2 4. return e.getE() Option (1) and (2) compile fine. Option (3) …

Member Avatar for ~s.o.s~
0
247
Member Avatar for eantz

Hi.. I have an XML file like this <?xml version="1.0" encoding="UTF-8"?> <player> <user> <username>destiya</username> <password>destiya</password> </user> <user> <username>dian</username> <password>dian</password> </user> </player> then I want to parse it with javascript and here is my javascript code : function loadXML(path) { var xhttp; xhttp = new XMLHttpRequest(); xhttp.open("GET", path, false); xhttp.send(); return …

0
53
Member Avatar for alikhandro

hi all,hope anyone can describe for me what is happining in this code,its about NaryTrees and am new with trees. public class NaryTree extends AbstractTree { protected Object key ; protected int degree ; protected NaryTree[ ] subtree ; public NaryTree(int degree){ key = null ; this.degree = degree ; …

Member Avatar for JamesCherrill
0
103
Member Avatar for mahes_

I am supposed to pass up my lab work a few weeks back..but i dont seem to get it rite.Pls help me see what is wrong with my code.....this is the question Write a class PlaneSeat that has the following features. Each PlaneSeat object should hold a seat identification number …

Member Avatar for Taywin
0
909
Member Avatar for GeKKeR

Good Afternoon all, I'm working on a project for school, and we have a part where we want a combobox filled with data from a mysql database, tabel = sport. We can work out how to fill a normal combobox just with strings, but we can't find out how to …

Member Avatar for JamesCherrill
0
668
Member Avatar for alikhandro

public void enqueue(Object obj) { if(count == size) throw new ContainerFullException(); else { array[rear] = obj; rear = (rear + 1) % size; count++; } } this is a code that add and object to a circular array.at the start the array is empty,rear=front=0. when we add the first element …

Member Avatar for Taywin
0
103
Member Avatar for psy.blast

Hello Daniweb Members, I am a beginner programmer and I have a problem, I am doing a PAT (Practical Assessment Task) for my school and I have come accross a huge problem, I'm trying to get a value from a selected combobox in Netbeans, (I am using the GUI builder), …

Member Avatar for JamesCherrill
0
244
Member Avatar for Pyler

Suppose I have a class with a constructor that takes in two strings is it okay to write the constructor this way? public class box{ private String s1; private String s2; public box(**String str1,String str2**){ s1=str1; s2=str2; } } Or can I just say public box(String str1,str2)?

Member Avatar for JamesCherrill
0
130
Member Avatar for rahul.ch

foo |-test |-xcom |-A.class |-B.java And two files: package xcom; public class A{} package xcom public class B extends A{} Given above directory structure where root dir is foo. Class B extends A. Question is: Which allows B.java to compile? The answer is: Set the current dir to *test* then …

Member Avatar for rahul.ch
0
1K
Member Avatar for paolieanne

` Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at finalprojectintersection.ProjectGUI.findbuttonActionPerformed(ProjectGUI.java:278) at finalprojectintersection.ProjectGUI.access$000(ProjectGUI.java:26) at finalprojectintersection.ProjectGUI$1.actionPerformed(ProjectGUI.java:133) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6505) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6270) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:703) …

Member Avatar for nmaillet
0
144
Member Avatar for bulldogs2016

I need help with the caesar cipher homework assignment, I am stuck and I do not know where to go in this problem. THis is the decoder which moves all the letters back three, but I do not know what is missing.. import java.io.*; import java.util.Scanner; public class AssignmentSix { …

Member Avatar for bulldogs2016
0
178
Member Avatar for hannahabigail.lewis

Can I get help writing a program for a 12 sided and 10 sided die and rolling snake eyes?

Member Avatar for JamesCherrill
0
85
Member Avatar for sk8ergirl

call method from another class Hi , I'm almost done with my practice paper I have done with the first part and now I'm working in the second part I came to this question and I stopped and didn't know how to call method from another class here is the …

Member Avatar for ObSys
0
205
Member Avatar for anglwthnati2de

Hi I want to be able to change the name of the JFrame I am working on. It is currently named SwimmingPoolVolumeCalculator. When I go the Company Tab and enter in a name, I want that name to be shown as the new Title of the JFrame. How can i …

Member Avatar for ObSys
0
1K
Member Avatar for yavindu

Are there any online resources to learn Java BCD ,if there are please send me some links. Thanks.

Member Avatar for JamesCherrill
0
43
Member Avatar for anandschiru

How to add an integer no to a date so tat i can a new date foe ex: date=10/11/2012 no=5 newdate=15/10/2012 **Any body plz help to solve the problem**

Member Avatar for anandschiru
0
301

The End.