32,204 Topics

Member Avatar for
Member Avatar for FUTURECompEng

public void Enqueue(int value){ node end = endList.next; end.next=null; endList.data=value; endList.next=end; endList=end; Here is my code for an Enqueue method but when I run it mylist.Enqueue(12); It gives me an error. Is something wrong with my method or am I testing it incorrectly? Thanks.

Member Avatar for FUTURECompEng
0
294
Member Avatar for calvintmoss

So I am trying to make a tile map editor/reader to create and interact with maps like [this](http://www.codeproject.com/KB/game/Autotiles_Algorithm/TileMapExample.png) , so essnetially I am wondering what the best way to go about this would be. I have not done anyhting graphical in programming in a long time and yeah, I was …

Member Avatar for ObSys
0
776
Member Avatar for riahc3

Hello I want to be able to be on a page and have a favorite that points to http://localhost/export which is a web service. When I select that favorite, the current web page Im on should send all of its source code to the web service. The web service should …

Member Avatar for Taywin
0
224
Member Avatar for boopathyraj

I want to align two text in same line first text should be in left side another one should be in right side of java swing textpane. so I have using style interface and Styleconstants class to align text but it couldn't worked. I have applied some other styles on …

Member Avatar for JamesCherrill
0
298
Member Avatar for subrat_p

Hello friends, I have created three JComboBoxes. first two of them get list from string. However I select these two comboboxes, the third combobox automatically retrieve data of a particular column from my database. But in my code its only get data from first item which automatically seleted by setmodel …

Member Avatar for mKorbel
0
421
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
912
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
679
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

The End.