35,618 Topics
![]() | |
[code]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class tictac2b1 implements ActionListener { /*Instance Variables*/ private int[][] winCombinations = new int[][] { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, //horizontal wins {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, //virticle wins {0, 4, 8}, {2, 4, 6} //diagonal … | |
Hello, This is my first post to the community. I have never really been one to ask of much help but I am stumped. I was asked to asked to write a word count program that received input from a scanner object. The input could consist of one or more … | |
Hi, I have written this piece of code: [CODE] public class testAssert { 2 public static void main(String[] args) { 3 int x = 5; 4 int y = 7; 5 assert x != y; 6 } 7 } [/CODE] I am not sure how to make use of this … | |
To me, what I want to do is extremely simple. I will have multiple users, each will login to a character with info stored in a database. Each user enters commands into a text field which will post the info to a page that will return the result of the … | |
Hi All, I am using ImageIcon to display an image, however, the image does not appear. See the code i am using below. Can you see what the problem is? The receivedImage will be taken out of an object it is stored in, and then i want to display it … | |
I have done a mortgage calculator program. it builds and run but I think tje GUI must be wrong because I cannot see it. I am very new to this and I am so lost. I do not know if this is the right forum. [code]import javax.swing.*; import java.awt.*; import … | |
how to change database at runtime, i use hibernate and spring. i have make like this hibernate.cfg.xml [code] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <mapping class="com.model.Person" /> <mapping class="com.model.Group" /> </session-factory> </hibernate-configuration> [/code] spring.ctx.xml [code] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" … | |
hello can you help me how to trap the textfield length..example if i will iput in my textfield 00001 then it will only accepts 4 digits can you help me how to make this trappings...hoping for your positive responds.... | |
Hi, I'm creating a Java Swing application that lets the user enter the usual details one would expect in an address book then click the save button. The current JPanel will then be hidden while another JPanel is shown. This second panel is used for viewing all the contacts added … | |
Hello; I am trying to build a JDesktopApp The structure of a Session in a web app: a user logs in and a session specific to the user is saved.(basically). My question is dealing with a Desktop app. If a user logs in can the same concept be used? I … | |
Hey all. Ok i've written the code below with no syntax errors. However, im struggling. 1) For Button 1 - Check Balance, I want to firstly bar out the pin number so it doesn't show. How do I do this? 2) For button 1 - I have added show input … | |
For a CS project, I need to have my program "gracefully terminate" in case of certain user input errors. What is the best syntax to do this? | |
Assignment: Create a program to practice reading in from a file, search for a particular word when the user inputs a word to search for and a file via command line args. Print out the entire line each time it is found. Progress: It compiles, and runs.... kinda. Problem: I … | |
How to store variables in the jsp page scope with the spring 2.5.x framework? This has compile errors. [CODE]import javax.servlet.jsp.PageContext; @Override public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pageContext; Object o = pageContext.getAttribute("com.mycompany.pageId");[/CODE] Description Resource Path Location Type The local variable pageContext may not have been initialized … | |
Hi , actually we are in need of free web space which supports services for JSP n servlets...Can anybody pls post me the link of that which provide above facilities...Thank you for readin ma thread | |
Hi, I'm trying my first program using servlets and JSP and would appreciate any help or advice about a problem I'm having. In my servlet I'm connecting to the database and displaying all the records in there. I'm then trying to add data to a JavaBean so that I can … | |
hey everyone. I am supposed to make a program that finds the smallest number out of a set of numbers. the amount of numbers input is up to the user. i have to print the smallest number, and what input it was (ex, 1st number 2nd number 3rd number...) i … | |
Hi guys, i need some help on my java homework. i need a text box which will have a piece of text. then i must show how many times every word has written in the text. in my way of thinking i should add every word to an array and … | |
Hi, I am stuck in building 2D Array from StringBuffer. I am reading data from a file and store it in a StringBuffer object by appending "\n" at the end. My read method is in the following. [CODE]public void tmFileReader() throws IOException { Work wrk=new Work(); StringBuffer buffer=new StringBuffer(); FileInputStream … | |
Hi, I am developing a TM simulation program. But got stuck in execution as it goes wrong. The Code is the follwing. 1. Java Code [CODE]import java.io.IOException; public class TMSimulation{ public static void main(String args[]) throws IOException{ InputReader reader=new InputReader(); reader.tmFileNamereader(); reader.tmFileReader(); //fileReader.display(anArray) } }[/CODE] [CODE]import java.io.*; public class InputReader{ … | |
hello! I have run into a brick wall trying to write a traffic light program. The program must display a traffic light (so far I have tried painting it on a Graphics) and use radio buttons (red, yellow, green) to change the color of the light. So far, I've got … | |
hi please can anyone help me with this code. the prob lies in the add function for some reason it only executes 2 lines of the code and as soon as i enter the data the program finishes [CODE] import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.io.*; class customers{ private … | |
Hey all, i'm looking for some help/advise on how to tackel a piece of code i'm stumped on. My project is in netbeans, GUI swing, JForm. Ive made up all my gui appearance, i have a jtext box that shows the calculations of 3 other jtext boxes from a user's … | |
Hi i need an event handler method to let an user use the 4 arrow keys (up,down,left,right) from a keyboard input ... and also the letters "Y" for yes and "N" for no on the keyboard. [code]import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; //group Albers, Rodriguez, Gonzalez, Leys, Larson, and Aponte … | |
![]() | Hi, I am getting a rather odd error message when I try compile a java program. I have attached the original java code and a copy of the error message in a .txt file. Any help you guys can offer will be much appreciated. ![]() |
I am using a PriorityBlockingQueue in my server program for a network printer manager, but the thing is whenever I print the size of the queue its always 1. I think it is cause i am using threads in my program to support multiple clients. How do i solve this … | |
Hi guys, I have written the following code which iterates over a integer array and returns a string by concatening the digits. Is there is an easier or more efficient way of writing this in Java similar to the C# function ToString? [CODE] private int[] myArray; public int[] getMyArray { … | |
I have one, reoccurring issue that arises each time I run this incomplete program I am working on; I have spent much time attempting to locate the bug. I am convinced it arises from a simple error. Problem: User has made a "deposit" but when the User makes a "withdrawal", … | |
Hi Everybody, Im having a bit of a problem with an assignment..Im trying to write a JDBC servlet which checks the value of a name in the database against the value inputed in a form..USER and PASS are the values inputted to the by user into the form.. The code … |
The End.