36,051 Topics
![]() | |
I wasn't sure if this should go in games development or here but it's java so I put it here. This is homework so please don't write my code for me. My assignment is to create a game. It has to have moving parts, keyboard controls, buttons, the works. I … | |
I'm trying to launch an .exe from a JButton on a java Jframe, any1 knows how to make it execute. [CODE]private void OKButton3ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } [/CODE] | |
Hello.. I am in search of how to play a video in full screen mode using java. I know how to play a video using the JMF. but i want to play the video in full screen desktop java applicaton .. Any solution....? | |
I am running into an error with NoSuchElementException, Please help! Here is the error: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:838) at java.util.Scanner.next(Scanner.java:1461) at java.util.Scanner.nextInt(Scanner.java:2091) at java.util.Scanner.nextInt(Scanner.java:2050) at Project.answerKey(Project.java:292) at Project.findMyAvg(Project.java:344) at Project.printMyResults(Project.java:269) at Project.printHeader(Project.java:203) at Project.main(Project.java:30) The code at line 292 is: [CODE]answer[count] = inScan.nextInt();[/CODE] the method is: [CODE] … | |
Hi, I'm a beginner with Java and I need help with an assignment: Write a program that will help the Toronto Blue Jay's scouts decide which players they should draft next year. For each player the scouts have been watching, a record has been prepared showing the player's name, age, … | |
![]() | Hi, i am currently doing a system for the rental video. I am new to java coding.. Problem is how to add data to access database using java coding in method? Thank you. ![]() |
Hey guys, I'm working on a project to use Huffman trees to compress a text file into binary. For instance, based on the frequency of the characters in a string like "aardvark", a - 3 r - 2 d - 1 v - 1 k - 1, compression using a … | |
How would I go about using swing components and graphics in the same program. Whenever I seem to add a swing component my graphics disappear. Please help. Thanks. My main Class [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ResistorColorCodeProgram implements MouseMotionListener, MouseListener, KeyListener{ public ResistorColorCodeProgram (){ JFrame resistorCCFrame … | |
I am populating combobox on checkbox checked or not click event. Here is code. I am not solving the bug, JS runs on chrome but not in both IE and Firefox. checkbox <input type="checkbox" onclick="selectinactivebatch(this.value);" id="inactive_batch" name="inactive_batch" <?php if(isset($_POST)) echo "checked";?>> AJAX Code function selectinactivebatch(checkboxvalue) { var check; if(checkboxvalue=='on') check=1; … | |
I am using Eclipse to develop an applet module, which requires a bunch of libraries. It runs correctly under the Eclipse environment. I would like to know how to embedded this code in a html page, or how to deploy this applet? | |
I am implementing an applet module which receiving an object sent from a servlet. The following is used to setup connection. [CODE]private URLConnection getServletConnection(String hostName) throws MalformedURLException, IOException { URL urlServlet = new URL(hostName); URLConnection con = urlServlet.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestProperty("Content-Type","application/x-java-serialized-object"); return con; } [/CODE] The following is the … | |
hello, please i make a code that i want it to work as follows: the user input 3 value and after an inspection(that i am not put it now, i want to try it now so i make the condition, if k%2==0)the input is be either spoof or valed,at the … | |
Hi all, Does anyone know what might be causing this error message when i try to send a SOAP Request. java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response? Regards | |
[CODE]import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexTest { public static void main(String[] args) { String regex = "([a-zA-Z'-]*[ ]*)*"; Pattern p = Pattern.compile(regex); String input = "Adarsh has been testing this issue for a very long time now!#!"; Matcher m = p.matcher(input); System.out.println("Called"); if(m.matches()) System.out.println("Matched"); else System.out.println("Not Matched"); if(input.matches(regex)) System.out.println("Matched"); … | |
Hi, I want to avoid the addition of the <tr> tag when i am rendering the following code in struts2. [code]<s:textfield name="students[#stat.index].lastName" /> <s:textfield name="students[#stat.index].firstName" /> <s:textfield name="students[#stat.index].userName" /> <s:textfield name="students[#stat.index].userPassword" />[/code] textfield tag will add <tr> tag before each row. I want to avoid the addition of this tr … | |
Hi Forum, I'm currently working on a project where I create a form in Javascript/HTMl(easy). By form, i mean an actual form where it shall contain combo boxes, drop-down lists, buttons etc. Something like a questionnaire. That's all good and simple enough. However, how can I use this questionnaire/form to … | |
Hi there, I've recently been given a project that I have to develop portlets for Liferay portal. I have absolutely no experience with portlets, although I do have experience with servlets. Portlets and Servlets have quite alot in common, but I honestly don't even know where to start. I've got … | |
In servlet side, I am trying to receive an vector sent from the applet. The code is like [CODE]InputStream in = request.getInputStream(); ObjectInputStream inputFromApplet = new ObjectInputStream(in); Vector v = (Vector)inputFromApplet.readObject(); [/CODE] But the compiler specifies that the following one is wrong. [CODE]Vector v = (Vector)inputFromApplet.readObject(); [/CODE] The error message … | |
I've had an idea for a class that, instead of storing a number as a single floating-point value, stores the exact value as two or more integers (in cases such as division, fractional exponents, or irrational numbers such as pi or e). The class would have it's own mathematical functions … | |
i am having problem in this code, i have written //ERROR, where i am getting error.... PLEASE HELP BASICALLUY, WHAT I AM DOING IS:- I HAVE A GENERATE AND OK BUTTON, WHENEVER I CLICK GENERATE BUTTON, A NEW SET OF INFO IS RETRIEVED FROM THE DATABASE AND THE TEXT FIELDS … | |
Is there a way to add data into a RandomAccessFile using seek(long) without writing over the data at that position and beyond? For example: [code] public static void main(String[] args) throws Exception { RandomAccessFile raf = new RandomAccessFile("test.txt", "rw"); raf.writeBytes("Hello, World!"); seek(2); raf.writeBytes("Goodbye, World!"); raf.close(); } [/code] Using that the … | |
hi i have a jsp page in which there is three radio button one is for dropdown list,another is for text field and last is for File field.What i want is when someone select dropdown list other two fields should be blanked and disabled.and when i select file field then … | |
How do i send a Soap request like the one below in Java.Links to SOAP for newbies will be much appreciated as well. [code=xml]<SOAP-ENV:Envelopexmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope"SOAP-ENV:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <SOAP-ENV:Body xmlns:m="http://www.xyz.org/quotations"> <m:GetQuotation> <m:QuotationsName>MiscroSoft</m:QuotationsName> </m:GetQuotation> </SOAP-ENV:Body></SOAP-ENV:Envelope>[/code] | |
How do i restrict access to other JFrame? if i open my main frame and click the add button, the user will not be able to go back to the main frame. how do i do that? | |
Hello, I want to know how can I call VB.NET (Server Side) function to Javascript (Client Side). I want to insert function here in my Javascript code; [CODE]function ConfirmSave() { var Ok = confirm('Proceed to Save?'); if(Ok==true) return true; else if(Ok!=true) return false; }[/CODE]I want to exefcute the Save() function … | |
Hey guys, I just found out that I'm a semifinalist in Google International Online Science Fair! Thats top 60 out of like 7,500 projects. Right now theres a People's Choice award contest on, with the reward being a $10K scholarship! Can I get some votes from you guys? Just takes … | |
i need help because i have an error on line 28 of OrderingCustomer that it says cannot access Customer? what did i make wrong in this program.? thanks the product and customer method it complied properly. my only concern is the line 28 of the OrderingCustomer. import java.util.*; import Product_.*; … | |
1. Create a Coffee class to represent a single hot beverage. Every Coffee object contains the following instance fields: a. A protected double variable named basePrice. This variable holds the cost of the beverage without accounting for any special options (cream, sugar, etc.). b. A protected ArrayList variable named options. … | |
I seem to have a problem refreshing the data within my JTable. I know the code is being run through. I have a JTable which is populated from a selection in a combo box, on first click within the combo box the table displays the correct data. So basically the … | |
So far, it's all working great, but all I need left is to get the method WORD1() to go to WORD2() when the person types in the correct letters. The first word is "Java". How would I make it so that when they type in "Java", it will go to … | |
I have a 3x3 array of text fields whose values get transferred to an int array. I need to make sure that integers 1-9 each occur once within the int array. Any ideas on how to go about that? I could do it by verifying that every int is between … | |
Hi ,I want to go back after the else to the if statement(step2),how can I do it [CODE]public class main { public static void main(String[] args) { gcd(12,23); } public static void gcd(int m,int n){ int uPrime=1; int vPrime=0; int u=0; int v=1; int mPrime=m; int nPrime=n; int counter=0; if(mPrime%nPrime==0)//step2 … | |
I'm trying to make a class called "Sprite", which is supposed to handle spritecards and such. However, I can't seem to be able to get the image height without having an image observer object. Do I have to pass the image observer from the main class to every sprite class … | |
I want to embed microsft notepad in my java application.... is there any way... i dont want to use java own made notepad.... | |
I currently have a Bellman Ford algorithm set up and I am trying to print the path to that node. My current algorithm is like this: [CODE] path = new int[totaledges]; path[source] = source; distance[source] = 0; String st = ""; for (int i = 0; i < totaledges; i++) … | |
The question how to create HTML output to the browser from a Servlet based on XML data often comes up. Here's a fully functional example on how to achieve this using Jakarta Xalan 2 and Xerces 2. The system is quite simple, most of the code is concerned with housekeeping … | |
that code that i have problem with it is only accept 2 input from me y and how to solve it please Scanner keyboard = new Scanner(System.in); String IP = keyboard.nextLine(); String TTL = keyboard.nextLine(); Scanner kb = new Scanner(System.in); String conntype = kb.nextLine(); thanks in advance | |
![]() | Hi everyone, I had designed an application with Java as front end and mysql as back end. The client application uses both local database as well as Remote mysql server's database for login and other retrievals. I don't know how to generalize the database connectivity code?, I need to access … ![]() |
Dear all I am making a program which adds lots of jlabels to a frame (the idea, eventually, is that each jlabel will link to a different program on my dekstop) The trimmed down code below shows that I have a script which creates an array of multiple jlabels which … | |
Hi,I have to write code in java and in the description is this symbol u' Can anybody tell me what is the meaning of it Set (u') | |
Hi there!!! I am new here and new student. I got a question here. If I want to detect whether there is an illegal charater(inside red) - other than what is provided now. how do i have to do it? Thanks in advance. [CODE]<html> <body> <% for (int i=0;i<5;i++) { … | |
I am stuck in quite a tricky problem, That is - My session which contains username is getting invalidating on page refresh in Firefox Mozilla. Same is working fine in IE-9 I am pasting the code of both header and index.jsp file. [U][B]Header.jsp[/B][/U] [CODE] <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <%@ taglib … | |
I need help completing the classes below, I don't think the code I have so far is correct because I keep getting errors. Please help me complete and understand the classes. 1. Create an abstract class named CoffeeOption. This class should have the following components: a. A protected double instance … | |
[CODE]/*********************************************************************************** * * File: Customer.java * * Author: Austin Smith * * Date: 04/04/2011 * * Description: The Customer class handles all client information * such as name and address. * **********************************************************************************/ public class Customer { /*** Defaults/Constants ***/ public static final String DEFAULT_NAME = "ERROR: Invalid Name"; public static … | |
Hi I need help creating a word count file, the file should print the name and number of times the words were counted in a file. I need to use the JFileChooser and the results should be printed in the resultArea of the JTextfield. example: and 33 use 24 Here … | |
Hi, i know how to open a file and read data from it but i wanna print out the number of lines in that file ? How would i go about this ? | |
I wanna know how to print only part of a string. For instance: [CODE] public static void main(String[] args){ String a = "daniweb.com"; System.out.println(a); } [/CODE] I wanna say print only characters after the 4th one so the output would be: [CODE]> web.com[/CODE] | |
I'm trying to program the traditional minesweeper game. I have problems with Swing as I'm not sure how to proceed. I tried adding one JPanel to a JFrame and then using JButtons to imitate the tile buttons. Then I encountered a problem when I tried to program the functionality of … | |
I'm trying to remove a JButton from a JPanel but my code does not work. Any help is appreciated. This is the JButton. Problem is the line 25 I guess. [CODE] class SquareButton extends JButton implements MouseListener { String text = null; GameArea ga = null; public SquareButton(GameArea ga) { … | |
1. A PROGRAM THAT PROVIDES THE INTERSECTION COORDINATES OF TWO LINES GIVEN THE COORDINATES OF LINE A AND LINE B. 2. A PROGRAM THAT WILL BE ABLE TO CALCULATE THE GRADIENT/SLOPE OF A LINE GIVEN TWO POINTS. i want to know what i am doing to do, how to even … |
The End.