36,051 Topics
![]() | |
I wrote the following code, and it seems to be working well up until the end. I do not get any error messages, but the last method has 5 lines that are supposed to print out. Nothing prints. Any ideas? Hints? Clues? Thanks! public class paintJobEstimator { public static void … | |
Now this is an assignment for me, but ive spent the last two weeks writing this code day and night, I just cant get it out of my head, I have to beat it lol. So anyway, two days ago I won and completed my program exactly the way I … | |
Hello. I now know how to allow the user to enter only numeric input in a FormattedTextField. What I need help with now is how to allow the user to only input letters. An example is what I have below. The problem I keep getting is it won't allow me … | |
Just got one more question. I tested in my java JMF program just now. I found that AVI format are not supported by JMF. and also wmv,wma; who can help me? thank you!!! | |
[code] String like=searchJTextField1.getText(); query=entityManager.createQuery("SELECT c FROM content c WHERE c.artist LIKE \"%" + like + "%\""); query.setParameter(like, searchJTextField1.getText()); [/code] is there someone that could tell me if this code is right? thanks -Steve | |
I have a very specific question. For one particular handset I'm using, playing a http stream, each time the player closes, there is a considerable delay i.e. 2 seconds, this is unacceptable as the music is not smooth. Does anyone one know of a way to improve the efficiency of … | |
If netbeans ide has a queryproperty set to SELECT c FROM Content c How can I change this query to say ..limit the resultset to less records like 10 or 20 instead of the whole database. I am not sure what that SQL string would look like. | |
Do you have some understanding of the netbeans6.0 concerning binding and queries? I have a jdesktop program from a tutorial using the netbeans ide. it automaticlally sets the query property to [icode]SELECT c FROM Content c[/icode] (which is somewhat foreign to me) however; I'd like to have another example of … | |
I'm just playing around with some code and I can't figure out why this isn't working. It's only "encrypting" one word. Can anyone tell me what's wrong with it? [code = java] import java.util.*; public class EncrypterDriver { static String encrypt(String fileMessage) { String encryptedMessage = ""; char fileChar = … | |
I'm new to JSP and trying to do a parameterized query. I've been able to do single stream queries to existing tables without any problem. I'm trying to build a search mechanism to do selective reporting. I've tried many hours to get the combination of different items to get by … | |
![]() | Hi, I hope this is the right place to post this topic. I'm building an imagealbum application. Registred users can visit certain parts of the album after authentication. So, the usermanagement and authentication process are build as servlets in Tomcat using a jdbcrealm. As the images are uploaded directly thru … |
I m trying to use <jsp:include page> with apache tomcat 5.5.26 as follows [code] 679:</table> 680: </td></tr> 681: <tr><td colspan=2 width="100%"> 682: <jsp:include page="html/policy.html" flush="true"/> 683: </td></tr> 684: <tr><td colspan = 2 align="center"> 685: <input type="hidden" name="hide" value="3"> [/code] where policy.html is html file to display policy. while trying to … | |
im designing a 12 hour clock, converting it from a 24 hour clock. i had the idea of keeping the clock internally as 24 hours, and externally showing it as a 12 hour clock. The code I have is public String getTime() { if (hours.getValue() >12) { hours.setValue(hours.getValue() - 12); … | |
Hi, I am quite new to regular expression and I am kinda stuck on this question. I am using a book which explains it only in short detail. I have an answer but am not sure if I got it right. If someone can please check it and post the … | |
Hi: I have to write a program that uses methods and arrays. I have to create a method that creates an array and populates it with 10 random numbers between 1 and 10 inclusive. Then I have to write another method that sorts the number from lowest to highest and … | |
I want create some custom controls. With the properties. can any one help me to develop that. which is use to develop custom controls, jsp or ejb or swings? | |
hello, i have written a program which selects each record in the database-table(having ip,status and other fields) pings to that ip and if a reply is obtained then the program establishes a socket conn b/w another comp and exchanges information,if info is exhanged then nothing is to be done to … | |
.,what is the best tutorial to know on how to insert an audio in my java program... -any advice is highly appreciated... alpe:) | |
Does anybody know if it is possible to keep a thread running that constantly checks for new processes being ran on the computer? | |
I'm trying to write a file that first decides if a number entered is prime or not, then if it is writes it to a file. Here's what I've got, but I keep coming up with a couple errors that I can't figure out how to fix. One is that … | |
I have the tutorial running with a entire database displayed. I am working with the tutorial at: [url]http://www.netbeans.org/kb/articles/mysql.html[/url] The above tutorial creates a jDesktopAPP. with components bound to the table. I am trying to add a button (basically). I am in the process of understanding binding. the program loads with … | |
i have a program running with lot of system.out.println statements.. i want to display this in a javaframe...can anyone tel me the steps to go abt it | |
i am some what new to java so i am not really familiar with all the errors and such but i am getting one that says this: [CODE]Exception in thread "main" java.lang.ClassCastException: lab8ab.EmployeeAryApplicEx cannot be cast to lab8ab.EmployeeMultiTypeSeqFileExer at lab8ab.EmployeeMultiTypeOpenListener.<init>(EmployeeMultiTypeOpenListener.java:22) at lab8ab.EmployeeAryApplicEx.<init>(EmployeeAryApplicEx.java:115) at lab8ab.EmployeeAryApplicEx.main(EmployeeAryApplicEx.java:43)[/CODE] what does that mean? the program … | |
Hello everyone. I had a quick question. How can I go about setting constraitnts for a JTextField. I'm trying to not allow users to enter any non numeric numbers, except for dollar signs, commas and periods. Also how can I restrict a JTextField to only allowing two numbers to be … | |
Hi all , I'm trying to display currency in Indian format but I'm getting question marks symbols instead of digits . Please tell me how to sort out this problem . Thanks in advance | |
Am working on a project to develop a database which should output to my mobile.Is there anyone who know any site which have resources for the database connectivity to the mobile?I will appreciate your help. Shaqnolysis | |
Hello everyone, I want to use javax.comm to do serial cable communication on Linux platform. Currently, I can not find enough learning materials (tutorials and samples) from searching the net. Could anyone help to recommend some good ones? thanks in advance, George | |
i have a code written in jsp to enter and edit user accounts. But for fields like Name its taking numeric values also, and also how to check an enter only valid format of e-mail in the e-mail id field. Is there any function in jsp like isAlpha, isAlphanumeric to … | |
how can we retrieve an employee or any persons database values when we enter that particular persons input values though a login html page ,using servlets | |
[code=java] import java.awt.Color; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class Testing extends JFrame { public static void main(String[] args){ SwingUtilities.invokeLater(new Runnable() { public void run(){ new Testing(); } }); } private Testing(){ super("tester"); launch(); } private void launch(){ setBounds(200, 200, 300, 300); setDefaultCloseOperation(EXIT_ON_CLOSE); JPanel topPanel = new … | |
I am working with the tutorial at: [url]http://www.netbeans.org/kb/articles/mysql.html[/url] Is there someone able to assist me in learning how to add a search functionality to the above tutorial? right now I am deciding if I need to transform th code (below) to the @Action,actionPerformed(),and class extending (@Action) Task. [code] public void … | |
I am a C++ programmer, but i am required to prepare a presentaion about Generics in Java I need someone to explain this function: public static <T> T do_something(T [ ] list) { … } Please show what every part indicates; <T> indicates: ..... T indicates : ..... ...... and … | |
I wrote a program to implement LinkedList : package JavaApplication; import JavaApplication.MyExciption; public class LinkedList<ListElementType> { class Node { ListElementType elem; Node next; } private Node head; private Node tail; private Node current; public LinkedList() { head=null; tail=null; current=null; } public void insert(ListElementType elem)throws MyExciption { Node addedNode=new Node(); if(addedNode==null) … | |
Hi I have written a script file which uses whiptail --inputbox to get an input and i want to execute this script from a java program... my java code is [code] Process process = Runtime.getRuntime().exec("/path/../myscript.sh"); [/code] but when i run my java code the script is not running. The whiptail … | |
Hi I have written a script file which uses whiptail --inputbox to get an input and i want to execute this script from a java program... my java code is [code] Process process = Runtime.getRuntime().exec("/path/../myscript.sh"); [/code] but when i run my java code the script is not running. The whiptail … | |
I am working with the tutorial at: http://www.netbeans.org/kb/articles/mysql.html can any one help me figure out why I can not set a query with this method? entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory ("splashbookdbPU").createEntityManager(); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance (splashtemplateda.SplashTemplateDAApp.class).getContext().getResourceMap (SplashTemplateDAView.class); query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery (resourceMap.getString("query.query")); // NOI18N list … | |
how to use AWT to write button tip? i don't want to use Swing. Please help me!:) | |
I want to Define class name MutiItemSale that represents a sale of multiple items of type Sale. The class MutiItemSale that have instance variable whose type is Sale[], which will be used as a partially filled array. There will also anther instance variable of type int that keep track of … | |
These are the only answers I could not find can anyone help me out please public class TestA { public static void main( String args[] ) { int x = 2, y = 20, counter = 0; for ( int j = y % x; j < 100; j += … | |
most oftenly u have said or heard the word JAVA BUT I WANT U TO EXPLAIN WHAT ACTUALLY JAVA IS I AM EAGER TO KNOW PLEASE NO SMART ANSWERS ANSWERS FROM PRO | |
With these codes [CODE]public boolean rogue() { if(rogue = true) { playerEquipment[playerHat]=5554; // set armor playerEquipment[playerCape]=6570; playerEquipment[playerAmulet]=6585; playerEquipment[playerChest]=1; playerEquipment[playerShield]=1; playerEquipment[playerLegs]=5555; playerEquipment[playerHands]=5556; playerEquipment[playerFeet]=5557; playerEquipment[playerRing]=1; playerEquipment[playerArrows]=1; playerEquipment[playerWeapon]=1; } } public booletan hunter() { if(hunter = true) { playerEquipment[playerHat]=1038; // set armor playerEquipment[playerCape]=6570; playerEquipment[playerAmulet]=6585; playerEquipment[playerChest]=-1; playerEquipment[playerShield]=-1; playerEquipment[playerLegs]=-1; playerEquipment[playerHands]=7462; playerEquipment[playerFeet]=-1; playerEquipment[playerRing]=6735; playerEquipment[playerArrows]=-1; playerEquipment[playerWeapon]=4151; } … | |
i have this pgm which receives a string and tries to find it in database and return a value. for the first execution its working fine, but if the string is not found in database and the pgm is to be restarted it doesnt work the output is init: deps-jar: … | |
Hi everyone, I've been trying to use an RMI Service from a JSP page, but whenever I try it I get an error of not finding the object. I've started the rmiregistry service, and the Services Implementations registers it, and when I run a class client I have for it, … | |
I am working with the tutorial at: [url]http://www.netbeans.org/kb/articles/mysql.html[/url] The program works great. untouched the program displays the entire database that is a result of of query.getResultSet(). I added a combobox,textfield,and a button with an action. I dragged and droped an additional: searchEnityManager1 bound to the preexisting splashbookdbPU searchQuery1 (bound to … | |
Can any one tell the Best Compression method for all types with Source code in java.... | |
can we use javascript inside css classes, Because I want to get the browser window width to the css width atribute. Thanks | |
If I have this line in the code[icode]java.util.Collection search = searchQuery1.getResultList();[/icode] Is this a collection of <list>? and can I find out if search should be named"Search" or does it have to be instantiated of something? | |
import java.util.*; public class changemakerj { static Scanner console=new Scanner (System.in); static final double PRICE = 10.50; public static void main (String[] Args) { double quantity,tprice,amtpaid,change1,chg$10,chg$5,chg$2,chg50,chg20,chg5,chg2,chg1; System.out.println("Enter the quantity:"); quantity=console.nextInt(); System.out.printf("Total price:$ %.2f.%n",tprice=quantity*PRICE,quantity); System.out.println(); System.out.println("Amount paid:$"); amtpaid=console.nextDouble(); System.out.println(); ; System.out.printf("Change:$ %.2f.%n",change1=amtpaid-tprice,amtpaid); System.out.println(); chg$10=(int)(change1/10); change1=change1 - (chg$10*10); System.out.println((int)(chg$10)+ ":$10.00"); chg$5=(int)(change1/5); System.out.println((int)(chg$5) … | |
When I add buttons to a panel, the buttons seem to take a huge amount of space. How do I get rid of the space? For example: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Tester { public static void main(String[] args) { JButton dayButton = new JButton("Day"); JButton … | |
Good day House, im a good fan of this forum and needs assistance on info and what on aspect to expect on Sun Certified Java Administrator (SCJA) exam. Or perhaps, there maybe anyone with material that could be of great use for me. Thanks |
The End.