32,199 Topics

Member Avatar for
Member Avatar for bleedi

Hey there, I've got a small problem. I'm writing an UDP client-server system, and I wanted to use streams with UDP. I found [UDPOutputStream](http://www.java2s.com/Code/Java/Network-Protocol/UDPOutputStream.htm) source and pasted it into my project. Now, when I try to initialize it, it freezes. This is how I try to initialize it: outStream = …

Member Avatar for bleedi
0
270
Member Avatar for dragonshadow001

Hello I'm tring to creat a specific Look in my Java JUI but my code is giving me errors when I try and launch it. Here is my code please take a look and tell me where i'm going wrong. Its a simple login interface for my program: import java.awt.*; …

Member Avatar for richieking
0
249
Member Avatar for LianaN

Hi! I'm trying to create a method for simultaneous dragging a group of JLabel components. First, I select the components to be dragged ([ICODE]getSelectedStatus() -> true[/ICODE]), and then I want to be able to drag the selected components. I have a working method for a single JLabel component, but there …

Member Avatar for anami
0
144
Member Avatar for Delnith

I am looking for your opinions on the best site or book in order to learn java. I am currently in school for C.S. learning C and would like to expand my knowledge. Thank you in advance.

Member Avatar for stultuske
0
273
Member Avatar for shaun smith

Hi, I'm using IReports to generate reports to my netbeans project. The reports which dosen't contain a chart, runs in the run time(Netbeans) and execute well. but when i add a bar chart to the report it gives the following exception even though the bar chart report successfully compile and …

Member Avatar for stultuske
0
177
Member Avatar for gotto

I am currently making a game and am working on the town code right now. I have booleans for the areas in and out of the town, but when I go to leave an area it resets me back at the beginning of the program. I have it set to …

Member Avatar for Adak
0
156
Member Avatar for gingerfish

hi whats the meaning of these signs? for example: [B]System.out.printf("[COLOR="Red"][U]%6s %6s %10s[/U][/COLOR]", "x1", "x2", "(y1, y2) \n");[/B]

Member Avatar for javaboy123
0
9K
Member Avatar for nagachaitanya

I want to add another Page to my Applet when clicked Submit, and to be clear need to retrieve data from the server where data is logs. please let me know what shall i do. package com.stage.logs; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.applet.*; import javax.swing.*; import javax.swing.plaf.TextUI; public …

0
66
Member Avatar for efth

Let's say I have a method called 'test' which should return the arraylist called 'theList' containing X number of Integers. How would I do that? public static void test(){ SOME CODE ... return theList } What should 'void' and 'theList' be replaced with in that code to make it work?

Member Avatar for efth
0
316
Member Avatar for utchia

Hi there i am trying to write a java code that will essentially be like a gps but a lot simplier and i need to make a mini map about 4 by 3. where Dunada and Government is the first intersection and i have already done so by using multiple …

Member Avatar for Taywin
0
135
Member Avatar for Kayla1993

I can not figure out why my code won't work. public static void GenerateRandomTriangles(int numTriangles) to create a file RandomTriangles.dat having the following format (including some comments like the ones shown below) with random integer coordinates (x, y) of the three vertices of a triangle. Each x and y will …

Member Avatar for Kayla1993
0
178
Member Avatar for nimmo

as i m working on implementation of rsa algorithm,and during maiking console of it i found an error int cannot be dereferenced and i m unable to solve it because of working on java first tym...help me here is my code import java.lang.*; import java.math.*; import java.util.*; class rsa { …

Member Avatar for Taywin
0
152
Member Avatar for Aditya.gtbit

Please help me...How to connect a jfilechooser and a jtree that takes the file system view of my pc..i need whenever a node is selected in jtree it automatically set as a current directory in the jfilechooser..

Member Avatar for BestJewSinceJC
0
564
Member Avatar for xixi.li.7

I create a UnorderedLinkedList to split my sublist public class UnorderedLinkedList<E extends Comparable<? super E>> extends LinkedList<E> { public void splitMid(LinkedList<E> subList) { Node<T> current;//the head pointer Node<T> mid;//the mid point //Node first = firstNode; //Node last = firstNode; //Node subListFirst; //Node subListLast; int i; if(head == null) { subList.head …

Member Avatar for xixi.li.7
0
161
Member Avatar for rajilakshmi

I want to create a windows appliation in java using Swing in Netbeans. I want to create the student maintenance details, with Mysql as backend. I dont know how to load the frames in single form. Example, if the user give user name and password in the text box and …

Member Avatar for stultuske
0
127
Member Avatar for sagaragrwal197

Hi sir, I am student and I like to know about the algorithm for developing a MLM software for my final submision So, kindly tell me which algorithm works for the MLM software developement...need urgently please help....

Member Avatar for Taywin
0
321
Member Avatar for alfiechiong

hi i need help is there anyone here have the knowledge of java to retrieved files in the folder and print it out im using this script File folder = new File("your/path"); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { System.out.println("File …

Member Avatar for Taywin
0
171
Member Avatar for taylor.mitchell.353

I took a different view with Delete States. I decided to implement it like the InsertAfter method by using a Boolean, but I am pretty sure I am doing it right, but it only displays one state after I implement it. My Code for the Delete /** * * @param …

Member Avatar for Taywin
0
157
Member Avatar for RozenKristal

import java.util.*; public class ArrayListTesting { public static void main(String []args) { LinkedList<String> list = new LinkedList<String>(); list.add("apple"); list.add("pear"); list.add("tree"); Iterator <String> iterate = list.iterator(); System.out.println(iterate.next()); System.out.println(iterate.previous()); System.out.println(iterate.next()); System.out.println(iterate.hasNext()); } } it keep telling me it an error.

Member Avatar for stultuske
0
264
Member Avatar for k22mac

Hello my question is fairly simple though I can't seem to find the solution. I'm writing a program that basically calculates the area of different shapes. I am making a seperate method per shape to do the calculations but in my main method I need to call the method according …

Member Avatar for JamesCherrill
0
189
Member Avatar for Seswing142

Here is my Code...Im just confused on how to make a Driver class for this. Any help would be great! I know there shouldnt be a Main but it was the only way i could test my drawing on eclipse since i dont really get how to use a driver. …

Member Avatar for Seswing142
0
95
Member Avatar for Yoink

Hi, I had an assignment where we had to fox a program and get it working correctly. I fixed 99% of the problems and the program runs correct. The only thing that is wrong is my insertionSort() method. It runs correctly, but in the wrong order. Currently its listing names …

Member Avatar for Yoink
0
3K
Member Avatar for taylor.mitchell.353

I have to insert State objects into the link list, but the linklist is sorted I placed my notes in my code. Any help would be appreciated. public void insertAddStack() { int probe=0, index=0; States key=null; for (; index < addStackItems; index++) //loops through keys { for (; probe < …

Member Avatar for taylor.mitchell.353
0
329
Member Avatar for pmark019

This code is a java code. Can you please help me convert this to c#? private static URL URLObj; private static URLConnection connect; static String source = ""; public static void main(String[] args) { try { URLObj = new URL("http://students.usls.edu.ph"); connect = URLObj.openConnection(); connect.setDoOutput(true); } catch (MalformedURLException ex) { System.out.println("The …

Member Avatar for cale.macdonald
0
465
Member Avatar for oneoderja

Ask an user to type in a password, a qualified password should follow the constraints, such as: Length of password >= 8 Include at least one uppercase character Include at least one lowercase character Include at least one integer Include at least special character Write a program to check if …

Member Avatar for Taywin
0
149
Member Avatar for plasticfood

public class QS { public static <T extends Comparable<? super T>> T[] quickSort(T[]array) { return doSort(array, 0, array.length - 1); } //some other methods................. public static void main(String [] args){ QS qs = new QS(); int [] nums = {4,7,23,1,2,45,23,11}; qs.quickSort(nums);//gives error } } I am getting an error in …

Member Avatar for plasticfood
0
135
Member Avatar for anonb

Im trying to get the output to read on one line such as this: Reference String 1 2 3 where 1,2,3 is the number the user enters. Instead the output is as such: 1 2 3 Reference String. How can I improve this to read correctly? import java.util.Scanner; public class …

Member Avatar for deben.salemme
0
132
Member Avatar for solomon_13000

The code below works: public class concat { public static void main(String[] args){ String[] filters = {"A","B","C","A","K","C"}; String[] values = {"1","2","3","4","5","6"}; String a = ""; for(int i=0;i<filters.length;i++){ String temp = filters[i]; for(int j=0;j<filters.length;j++){ if(filters[j].equalsIgnoreCase(temp)){ a += values[j] + " "; values[j]=""; } } if(a.trim().length()!=0){ System.out.println(temp + " [" + a …

Member Avatar for Taywin
0
112
Member Avatar for jcatrett5150

Having an error code and my brain is fried. Can someone please help Here is the part of the code that the exception points to.

Member Avatar for Taywin
0
170
Member Avatar for anandschiru

import javax.swing.* ; import java.awt.event.*; import java.awt.*; import java.io.*; import java.util.Calendar; import java.util.*; import java.text.*; /* <applet code="gui.class" width=250 height=100> </applet> */ class gui extends JApplet implements ActionListener { JTextField t1,t2,t3,t4,t5; JLabel l1,l2,l3,l4,l5,l6; JButton b1,b2; Calendar c1,c2,c3; JPanel p,p1,p2; Date sd,sd1; SimpleDateFormat sdf; public void init() { SimpleDateFormat sdf = …

Member Avatar for Taywin
0
321

The End.