35,618 Topics

Member Avatar for
Member Avatar for marcel25

[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 …

Member Avatar for BestJewSinceJC
0
92
Member Avatar for Unitaren

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 …

Member Avatar for Unitaren
0
5K
Member Avatar for johndoe444

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 …

Member Avatar for johndoe444
0
196
Member Avatar for Millsington

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 …

0
51
Member Avatar for spacecowboy123

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 …

Member Avatar for Abdelr7man
0
198
Member Avatar for Swingjohn

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 …

Member Avatar for Swingjohn
0
223
Member Avatar for onsir

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" …

Member Avatar for keerthi166
0
1K
Member Avatar for jemz

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....

Member Avatar for BestJewSinceJC
0
55
Member Avatar for dsmush

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 …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for ceyesuma

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 …

Member Avatar for ceyesuma
0
124
Member Avatar for sabah_786

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 …

Member Avatar for sabah_786
0
277
Member Avatar for lrolsto1

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?

Member Avatar for aspire1
0
77
Member Avatar for lrolsto1

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 …

Member Avatar for BhagatS
0
90
Member Avatar for albertkao

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 …

Member Avatar for albertkao
0
121
Member Avatar for pavan146

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

Member Avatar for peter_budo
0
78
Member Avatar for rumpleteaser33

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 …

Member Avatar for peter_budo
0
168
Member Avatar for shroomiin

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 …

Member Avatar for dlucke17
0
114
Member Avatar for hsncvs

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 …

Member Avatar for stultuske
0
102
Member Avatar for shahab.burki

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 …

Member Avatar for BestJewSinceJC
0
163
Member Avatar for shahab.burki

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{ …

Member Avatar for BestJewSinceJC
0
142
Member Avatar for aym312

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 …

Member Avatar for aym312
0
1K
Member Avatar for kesh1000

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 …

Member Avatar for kesh1000
0
132
Member Avatar for harika.jo
Member Avatar for chloeclover

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 …

Member Avatar for peter_budo
0
262
Member Avatar for BEBELINDO

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 …

Member Avatar for stultuske
0
125
Member Avatar for OzY360

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.

Member Avatar for OzY360
0
134
Member Avatar for rogue005

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 …

Member Avatar for rogue005
0
142
Member Avatar for rowdyboudy

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 { …

Member Avatar for peter_budo
0
139
Member Avatar for mattyd

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", …

Member Avatar for peter_budo
0
96
Member Avatar for oggiemc

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 …

Member Avatar for oggiemc
0
82

The End.