32,199 Topics

Member Avatar for
Member Avatar for christiangirl

Hey, I am trying to find a way to limit how many characters a user can enter into a JTextField. Does anyone know how to do this? Thanks!

Member Avatar for kvprajapati
0
141
Member Avatar for christiangirl

Hello, I am having problems with indexOf() and contains() they work if I put letters in the code to test, but I want it to test what the user enters. And that is not working. The user enters a letter into a JTextField, and I am storing that word to …

Member Avatar for kvprajapati
0
170
Member Avatar for JamesKox

Hello guys, I'm trying to create a method where it takes a InputStream as a parameter, reads the stream and returns the number of characters it contains as an int. I'm having difficulties with this. I've searched the internet for examples, but i can't find one that helps me with …

Member Avatar for kvprajapati
0
2K
Member Avatar for chengkochung

Hi There, We have one java class which is to do the document generating, and from the log files we found that this servlet doing the replacing the data "PK" to "Key", wondering why it doing this. 2009-05-22 12:07:24,921 [ (self-tuning)'] DEBUG rk.servlet.PDFGeneratorServlet - Replacing the PK's with Key values …

Member Avatar for kvprajapati
0
117
Member Avatar for kashn

Hi, I'm trying to figure out how can I make split read from the file and recognize how to put the strings into an array from a file, based on a new line break. Example of my txt file: [ICODE]This will be my first huge paragraph, it will contain many …

Member Avatar for javaAddict
0
217
Member Avatar for flash121

I want to read a jpg image from a file to an Image object and then paint it on my JPanel, but the image doesn't appear.I've tried drawing some other stuff on the panel (like lines etc.) and everything appeared without any problems. My code: This class represents my JPanel: …

Member Avatar for flash121
0
175
Member Avatar for Isy

I am creating a mobile game using Netbeans IDE 6.0.1 but I have a problem adding new configuration I get the following error: java.lang.NullPointerException at org.netbeans.modules.mobility.project.ui.customizer.NewConfigurationPanel.isValid(NewConfigurationPanel.java:198) at java.awt.Component.invalidateIfValid(Component.java:2740) at java.awt.Component.setLocale(Component.java:1810) at javax.swing.JComponent.<init>(JComponent.java:595) at javax.swing.JPanel.<init>(JPanel.java:65) at javax.swing.JPanel.<init>(JPanel.java:92) at javax.swing.JPanel.<init>(JPanel.java:100) at org.netbeans.modules.mobility.project.ui.customizer.NewConfigurationPanel.<init>(NewConfigurationPanel.java:96) at org.netbeans.modules.mobility.project.ui.customizer.J2MECustomizer.run(J2MECustomizer.java:304) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) anyone know what …

Member Avatar for peter_budo
0
249
Member Avatar for custurd12

[code] import java.io.*; import java.util.*; public class lab11_2{ Scanner in=new Scanner(System.in); private int month=12; private int sum; private int value; private int rainfall; private double total=0; private double average; private double standard_deviation; private double largest; private double smallest; private double months[]; public lab11_2(){ months=new double[12]; } public void setMonths(){ for(int …

Member Avatar for JamesCherrill
0
2K
Member Avatar for gigantic

hi, i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the following code. in the following code i am using [b]SelectionArea[/b] class which extends a canvas on which …

Member Avatar for zyaday
0
674
Member Avatar for soultrav

How do i compare an object with null? From what i've seen right now, at execution an NullPointerException will be thrown :S For example, if I have a list: [code=java] class List { private Node data; private Lista urm; public List(Node d,Lista u) { data = d; urm = u; …

Member Avatar for Zibo
0
7K
Member Avatar for Frostra

Below I described a complex polynomial which is a part of my newton method. When I define the complex number [x = new ComplexNumber (0,0)] it only returns 0 or 1. Also I have overriden the basic string format to make it look like a complex number, but it doesn't …

Member Avatar for javaAddict
0
164
Member Avatar for mohiit
Member Avatar for Poppystar

I am new to programming and am trying to create a program to access a database of DVD's. I want to input a unique code for a title and display relevant fields from that record. I am getting the error above and have spent many hours now trying to see …

Member Avatar for Poppystar
0
577
Member Avatar for lifeismusic434

Hello everyone, I am trying to update a JTable after a user clicks a button. I have a bunch of data in a TreeMap, which I then convert to a String[][], and pass to a DefaultTableModel, and then use that DefaultTableModel in the JTable. When the user clicks a button, …

Member Avatar for lifeismusic434
0
99
Member Avatar for JustmeVSI

Hi. My problem i guess it is simple but i guess I'm simple as well :). The problem is the flowing: I have a JTextFead and a search method for IDs. The IDs are 7 char long. I want to be able when the user enters 7 chars the search …

Member Avatar for JustmeVSI
0
104
Member Avatar for KirkPatrick

Just had a quick question about my code. Seems like a very simple solution, perhaps I'm just too sleepy to think straight. What I am wanting to do is if a certain index is selected in my combobox i want certain textfields to display which is apparent by the code: …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Dendei

Hi me and my class are getting this problem with tim.start(); and stop. we get start to work with a button but cant stop and we can stop with the keyboard but not with the buttons bad explaination i know but have an look plz :P [CODE] /* * To …

Member Avatar for Dendei
0
124
Member Avatar for grisha83

Hello, For some reason, my program prints out extra zero from my linked list Can anyone tell me why? Thank you [ICODE]public class Main { public static void main(String[] args) { IntNode my = new IntNode(5,null); LinkedList list = new LinkedList(); list.createList(0); list.addValue(1); list.addValue(23); list.addValue(3); list.addValue(4); list.print(); list.getLength(); } }[/ICODE] …

Member Avatar for grisha83
0
90
Member Avatar for grisha83

Hello, I was wondering why do we need to assign value of -1 to the top of the stack? topOfStack = -1; Thank you

Member Avatar for grisha83
0
96
Member Avatar for username7260

Ok, i got this so far ... [code] import java.util.regex.Matcher; import java.util.regex.Pattern; public class Testing2 { public static void main(String[] args) { Pattern p = Pattern.compile("[wati]"); String text = "water"; Matcher m = p.matcher(text); if (m.find()) { System.out.print("Found !"); } } } [/code] With that code i got a match, …

Member Avatar for masijade
0
131
Member Avatar for DeathWalker101

Hey all, Im working with assembly atm and thought i might just get a better idea understanding loops if i know how java loops work not that it is really the same im just trying to back track. Im trying todo the following: When var1 = 3 It then needs …

Member Avatar for tux4life
0
81
Member Avatar for airey1988

Hi i have created a list which reads from a text file. how can i view the contennts of the list outside of the method it was created. I have inserted my code below. [ICODE]//read Customers.txt and save in an object. List<Customer2> list = new ArrayList<Customer2>(); File file = new …

Member Avatar for giri.pankaj
0
79
Member Avatar for vedmack

Hi ... i found a way to add watermark in java to the following images format: PNG , JPG , GIF... (like this: [url]http://blog.codebeach.com/2008/02/watermarking-images-in-java-servlet.html[/url]) Now im looking for a way to do the same with BMP and TIF... (cause this way doesn't work on that format...) Anyone know how to …

Member Avatar for peter_budo
0
174
Member Avatar for ronnexngh

Im trying to program a Caeser cipher that will upload a file from documents and enrypt/decrypt it. i do not know how to implement one main class containing all that and different methods in one class. i have different separate classes. can anyone pls put them together as one main …

0
52
Member Avatar for onsir

I have design report with ireport, if that report i run in netbeans its ok, but while i move to drive c: got error like this "error displaying report page. see the console for details" if i try in command prompt get message [code] java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown …

0
100
Member Avatar for AS_82

What is the difference between s/mime ,tsp and pgp? Reference :encoding type in Bouncy Castle.org , jar download

0
64
Member Avatar for drawer1001

I am facing a problem here. I want move a trianngle shape and a reatangle shape using only one slider. I have created the two shapes And each of this shape is selected what i click the corrosponding button. two buttons are used to select two shapes Can any onw …

0
35
Member Avatar for suretd

Good Day All, I have another question: I have done this program to sort a list of artist and their biggest hits, etc. It has 4 parallel arrays that i have to sort alphabetically using the Sort Option in the menu bar. I am using Bubble sort, to sort the …

Member Avatar for VernonDozier
0
147
Member Avatar for blur0224

I'm trying to develop a simple program that automatically downloads PDF files from a web server and organizes them into Files. When I download any .pdf file, the size is roughly 30% bigger than when I download it with a browser and it pdf opens, but does not display. So …

Member Avatar for blur0224
0
214
Member Avatar for onlinegear

hi there i am trying to creat a subtotal for each row i have created and for each item in the combo box i dont know how to do this can some help plz [CODE] /* * To change this template, choose Tools | Templates * and open the template …

Member Avatar for peace_of_mind
0
113

The End.