32,204 Topics
| |
guys, good day... I know that this is just easy but i've been tweening my work the whole afternoon but no luck. my problem is using setAttribute for java's client-side programming. I just want to create session for my username to be able to use while being logged in. this … | |
I want to display a message input by a user on an applet /** * @(#)Hello.java * * Hello Applet application * * @author * @version 1.00 2011/3/17 */ import java.awt.*; import java.applet.*; import java.io.Console.*; import java.io.*; public class Hello extends Applet { public void init() { } public void … | |
I want to display the quote (character) into a text in netbeans Swing form. But it shows only last character. Any help would be appreciated. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: String t = encodeText.getText(); String text = t.toUpperCase(); int[]textnum = new int[text.length()]; for(int … | |
Right now my program says there is an error in line 27 of this code: [CODE]Class Netflix: public class Netflix { private static void main(String[]args) { String comedy, horror, drama, action, genre1; Movie a = new Movie(); a.setTitle("Avatar"); a.setCast("Sam Worthington"); a.setGenre('a'); a.setYear(2009); a.setStars(3); Movie b = new Movie (); b.setTitle("Battle … | |
[code] /** * @(#)GameOfLife.java * * GameOfLife application * * @author Ramanpreet Singh (romiaujla) * @version 1.00 2011/2/11 */ import java.util.Scanner; public class GameOfLife { public static void main(String[] args) { Scanner scan = new Scanner(System.in); final int SIZE = 10; final int GENCOUNT = 9; int i, j, k; … | |
I have an assignment where I need to do some operations on polynomials (add, multiply, ...) which are represented by linked lists. Part of the assignment is to make an inner class Term containing two int fields and a constructor with coef and exp ints) I also need an inner … | |
Hello I am down to 1 error can anyone please assist; java:41: not a statement + "P or p (premium): "; It is part of this section; System.out.print ("Enter the service type:") + "R or r (regular), " + "P or p (premium): "; serviceType = console.next ().charAt (0); System.out.println(); | |
Alright, so I'm suppose to be using SAXparser to parse a XML file and output certain parts The assignment asks us to use to classes Course.java and TextBook.java to which we are suppose to create the Course and Textbook objects described in the XML file, making sure they refer to … | |
Polybius Square is a table that allows someone to translate letters into numbers. To give a small level of encryption, this table can be randomized and shared with the recipient. In order to fit the 26 letters of the alphabet into the 25 spots created by the table, the letters … | |
hey, i have x and y coordinates that move around the screen randomly the position of the coordinates always vary they could suddenly stop or the movement speed could increase. what i want is to find out at what speed the coordinates are traveling in miles per hour. (not necessarily … | |
Hi everyone, For a group assignment we have to develop a property trading game similar to monopoly. At the moment we have the GUI developed as well as a basic idea of how to go about doing it but was wondering if anyone could help a bit!:S Is it possible … | |
Hi, currently i created a lucene project and currently having a problem with the codes. Here are my codes (which i also refer to some useful websites explain lucene) [CODE] import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.queryParser.ParseException; import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.Hits; import org.apache.lucene.index.*; … | |
Hi all, How do i store matching substring and string inside one single arraylist? example: [[er, every, errant]] which saying er substring is inside string every and errant.how should i make the comparison? basically what i did is only make 2 arraylist a1 = new ArrayList(); a2 = new ArrayList(); … | |
i m a student of BCS final year . i want to developed a games in java . any one have idea about game . plz share with me thank you! | |
hai..my name is harinath. i cant find javax.speech package anywhere .. how can i get javax.speech package??????? | |
Well, here's my problem. I have to Count from Num1 to Num2 by input from the user. So when I input let say 1 to 5, it will display 1 3 5. If I do 2 to 6, it would display 3 and 5. I can't seem to get the … | |
[code]import java.io.*; class caesercipher { String str; int key; public void main()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("ENTER A STRING"); str=br.readLine(); System.out.println("ENTER A SHIFT"); key=Integer.parseInt(br.readLine()); String encrypted=encrypt(str,key); System.out.println(encrypted); String decrypted=decrypt(encrypted,key); System.out.println(decrypted); } public String encrypt(String str,int key) { String encrypted=""; int i; for(i=0;i<str.length();i++) { int c=str.charAt(i); if(Character.isUpperCase(c)) { c+=(key%26); … | |
A matrix to be designed in following manner for a n x n order : 1 5 9 2 12 13 14 6 8 16 15 10 4 11 7 3 view sourceprint?01 int i,j,k,l,m,b=n; 02 int w=1, x=2, y=3, z=4; 03 int a[][] = new int[n][n]; 04 for(i=0;i<=n/2;i++) 05 … | |
Hey everyone, New to Java and i was hoping if anyone could assist me.I needed to write a program that could display results of Champions League initial menu screen with the following set of options: 1. Display the current score for each possible response. 2. Vote 3. Quit the program. … | |
Hi ,I have super class vehicle,truck extends vehicle,and I created array in test class full with objects from vehicle and truck,how can I call method from vehicle,is this the way (truck)object1[1].getMethod() | |
I trying to finish this assignment for Java and it's really getting to me. I haven't had this much trouble in the past, but things ramped up pretty quickly and I'm really stuck. I'll post what I have, although it's not much, if someone out there is kind enough to … | |
Hi, first time poster, and fairly new to java swing.Im trying to make a scrabble game and am stuck while trying to place a letter on the board, or even removing one for that matter. The playing board is just an array of JButtons all derived from a ScrabbleButton object, … | |
Hello, The following custom class has compiler errors where it is not recognizing KeyListener. Any idea on why I am getting this error? [CODE]import java.util.concurrent.*; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class worker1 extends Thread { private SynchronousQueue<Object> q; private int i; public worker1(SynchronousQueue<Object> q) { super("Worker … | |
[CODE] import java.io.*; import java.net.*; public class Server { ServerSocket ss; ObjectOutputStream oos; ObjectInputStream ois; public Server() { try { ss = new ServerSocket(8888); } catch(IOException e) { e.printStackTrace(); } } public void run() { String message; try { Socket sock = ss.accept(); System.out.println ("Connection received from " + sock.getInetAddress().getHostName()); … | |
| Hey guys!! first off please dont tell me to google it, iv already done my searching with google and various text books lol ... Ok So i understand how to find numbers in a linear search by inputting 10 numbers and searching. Now i need to do the same except … |
Hi - Im creating the game "Tanks" for the fun of it. Im fine with creating and adding the images and other inner game workings but I have digressed abit and have encountered a problem. The problem is this: I have painted the tank image to the panel but wanted … | |
the below code display the bill date fields empty when testing the code.can someone assist in identifying the error? [code]String custId = request.getParameter("customerId"); String emailId = request.getParameter("emailId"); String phoneNumber = request.getParameter("phoneNumber"); String[] dateStr = new String[3]; String[] status = new String[3]; try { //Code to connect to the database String … | |
hey, i have got three sets of x an y coordinates , where one of the x y coordinates keeps on changing all the time. lets say i have first set where the coordinates are int x=100 and int y=100; second set would be : int x=100; int y=150; but … | |
I have created a java application in which JTextpane is used as an editor. Now my problem is that when I select a block of text and press tab key, it automatically deletes the selected text contents. I don't expect these behaviour for my tool's editor. I need to add … | |
Hi there, we are trying to do a project on Web based video conferencing.. i guess we will test it on LAN. it will be a web page where multiple users can perform video conference... we are confused which platform to use for this? Java or C#, please suggest kindly.. … |
The End.