36,051 Topics

Member Avatar for
Member Avatar for Yogeshp

Hi, I was not able to see a spring section. I saw some posts here related to spring, so i am posting it here. I have a requirement. I am working with Java-Spring MVC 3.0 framework. And i am working with form tags too in my JSP. I have the …

Member Avatar for subramanya.vl
0
807
Member Avatar for NardCake

Hello! This is my first post, I'm new to java and I found when I search for things this site often shows itself on google results so why not join? Anyways I'm creating a text editor in java and I want to find out how to in for example windows …

Member Avatar for JamesCherrill
0
231
Member Avatar for sach_ak47

Hi guys i am new here i want to help about: how to convert digit(number) into word for example: Enter a number:123 Output:one hundred twenty-three

Member Avatar for stultuske
0
2K
Member Avatar for hwoarang69

first buid array with images's --90 images PImage pic[]; void setup() { size(900,900); pic = new PImage[90]; for(int i = 0; i < 90; i++) { pic[i] = loadImage("section_"+i+".jpg"); } frameRate(0.5); smooth(); } than prnt image on screen int i = 0; int counter = 0; int flag = 0; …

0
85
Member Avatar for Yarra

hi, so i coded a projectile motion java applet, not only with this but with many other programs i get problems which seem to me to be a memory issue. But the first time lets say I shoot hte projectile it will not show the screen until it has landed …

Member Avatar for Yarra
0
149
Member Avatar for koppche

I have to do a program dealing with 2 bank accounts. I must have a balance and a number of transactions. It also has to deal with draining a customers account and transfering the amount into the account that called the method. I have the rest of the code written …

Member Avatar for Taywin
0
136
Member Avatar for Otter992

Basically part of my project was to take the rows of pixels from a picture and make each row display twice, and the same for the column, and then eventually do them both together. However, I am having trouble with my loop to duplicate the rows or column. What I …

Member Avatar for Taywin
0
198
Member Avatar for nah094020

Ok so this is my task: Description: Create a generic class called GenBinTree. GenBinTree will use nodes that store a value of the generic type to store its contents. This tree will not be a search tree (no ordering of nodes by value). What ges me its the the part …

Member Avatar for Taywin
0
653
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
276
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
252
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
149
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
276
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
178
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
159
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
72
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
322
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
139
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
180
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
153
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
574
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
164
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
130
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
333
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
174
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
162
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
271
Member Avatar for raul8

Using Ajax after an year...please tell me what I'm missing: JSP/Ajax File: [CODE]<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script type="text/javascript"> function login() { var xmlhttp; var username = document.getElementById('username').value; var queryString = "username="+username; …

Member Avatar for i_M_patil
0
251
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
191
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
98
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
333
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
466
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
152
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
137
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
137
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
115
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
173
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
344
Member Avatar for RabbitruN

/*I am trying to generate 6 random unique (1-49) no.s and understand that my validation is incorrect.Help Please?*/ [code] import java.util.*; import javax.swing.JOptionPane; public class ranUnique { public static void main(String[] args) { String output=""; int[] arrayRan=new int[6];int ran2; for(int ran=0;ran<arrayRan.length;ran++){ arrayRan[ran]=(int)(Math.random()*50 //validate for(ran2=0;ran2<=ran;ran2++){ if ((arrayRan[ran]==arrayRan[ran2]) || (arrayRan[ran]==0)) { arrayRan[ran]=(int)(Math.random()... …

Member Avatar for sanketh_java
0
262
Member Avatar for hakeemtunde

hi guys, am stil new to java their was a snippest code about getting screen size i've being seeing onine calling window.getSize() in what package is the object located. // Get the size of the screen Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); // Determine the new location of the window int w …

Member Avatar for hakeemtunde
0
182
Member Avatar for Mauricejude1

Derive an algorithm which updates the ith elements from the top of the stack, upgrade this algorithm to calculate the maximum value among the contents of the task. Hence write a java program to implement this task

Member Avatar for JamesCherrill
0
98
Member Avatar for sam.ndhlovu

Hi everyone,can anyone explain to me how to develop the Sokoban game in Java?Like a step by Step,am a newbie

Member Avatar for JamesCherrill
0
46
Member Avatar for Neversleepin

HI, could someone explain me this line of code: public void createTextFile(Layer layer, String prcString, String arString) { File fileStatPercent = new File(fileName+layer.getName() + "Test.txt"); try { BufferedWriter out = new BufferedWriter(new FileWriter(fileName + layer.getName() + "Test.txt")); out.write("something"); out.newLine(); out.write(prctString); out.newLine(); out.write("something"); out.newLine(); out.write(arString); out.write("\n"); out.close(); Thank you, i don't …

Member Avatar for JamesCherrill
0
182
Member Avatar for eskember

Hi! I'm a 2nd Year IT Student and right now I have a problem in creating an Address Book Program using Java Codes.. It has never been discussed to us in class so i really don't know how to do it but look for it online.. I have used Mr./Ms. …

Member Avatar for harinath_2007
0
792
Member Avatar for Malymieczek

Hi all, I have a program that I have to write with an output that looks like this: ---------------------------------------------------------- Wages for 3 employees For 10 hours worked, the wages are 120 dollars For 20 hours worked, the wages are 240 dollars For 30 hours worked, the wages are 360 dollars …

Member Avatar for Malymieczek
0
131
Member Avatar for Lushomo
Member Avatar for Taywin
0
54
Member Avatar for babi.meloo

I need to design an application that reads a string from the user, then determines and prints how many of each lowercase vowel appear in the entire string. Separate counter for each vowel. I also need to count and print the number of consonants, spaces, and punctuation marks. The problem …

Member Avatar for Taywin
0
1K
Member Avatar for Kayla1993

Need help writing code for generating random triangles. You will have the following functions (no violation of these interfaces) and you may have others, as needed: − 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 …

Member Avatar for Taywin
0
94
Member Avatar for Pyler

consider public class awah{ private int x=0; private int y; private int w; public awah(int width){ w=width; } public void sety(){ y=(Int)(Math.random()*4);}//meth1 public int gety(){ return y; } public void setx (){ x+=this.gety(); } public int getx(){ return x; } public void showUpdate(){ System.out.println(x); } }//end of awah public static …

Member Avatar for Taywin
0
216

The End.