35,618 Topics

Member Avatar for
Member Avatar for h0427

Hi, I'm working on a project and I am stuck on the AccountTest.java right at where the program is supposed to process the transaction-code within a while-loop. Below is the pseudocode for that was written for this particular assignment. This is my first post so I hope that I've formated …

Member Avatar for dantinkakkar
0
4K
Member Avatar for Navlag

My code(below) displays only one "message" at a time and then prompts the user to delete the message in order to create a new one. How can I make it so that the user can constantly add new messages without having to delete the previous message? [CODE]import java.security.SecureRandom; import java.util.Iterator; …

Member Avatar for stultuske
0
339
Member Avatar for vince8864

Hi, Here is the challenge for first jsp based project. Originally, i have an authentication.jsp that passes form to authentication java class for username and password matching. Then the java class will redirect to other jsp if it matches. After that, i wanted to solve the logout problem related to …

Member Avatar for anand01
0
132
Member Avatar for rayden150

first i tried with system.out.. then i tried this: [CODE]import javax.swing.*; import java.awt.*; public class Ejer1 { public static void main(String [] args){ JTextArea graphs = new JTextArea(); String [] graph1 = {"*********"}; String [] graph2 = {"%s\n%s\n%s\n%s\n%s\n", "* *","* *","* *", "* *", "* *","*", "* *","* *","* *","* …

Member Avatar for Xeno999
0
189
Member Avatar for TrickyT

hi, all ... very new to java, but plugging along somehow ... however, i have an assignment that wants me to find the value of all of the inventory of a product and i have the entire code, but the method that i created to calculate the value ... calculateTotInvent() …

Member Avatar for TrickyT
0
190
Member Avatar for bivashkumar41

i m working on a project and i want to implement a java code such that if user enters a number say 5 then after submitting on the next frame 5 textboxes should be displayed?? please help me!!

Member Avatar for bivashkumar41
0
118
Member Avatar for dennysimon

hello all how to put more than one JLabel in a vertical direction,and right align by computing the length of each of JLabel.Text so the appearance like below Name: Position: age: thank you denny

Member Avatar for zeroliken
0
70
Member Avatar for bluealein56

I know alot of you guys get the same posts over and over about intro JavaII Classes, but I have tried to refrain from asking something that has already been solved and try learning on my own, but Im stumped. Im having trouble with this program, specifically at my calculation …

Member Avatar for zeroliken
0
810
Member Avatar for knitex

I have recently started using VIM for writing java code so I'm still getting use to the things i can do with it. I'm having trouble compelling the file directly in vim. I would like to have it so i can use :compile to compile the programs and then it …

0
165
Member Avatar for aanders5

How do I clear/renew/empty/refresh a 2D JButton Array? I've tried a lot of things, but all that is happening is the new 2D array, just adds onto the old one, which is not what I want. It won't even just overwrite the old array. So i am not sure what …

Member Avatar for aanders5
0
259
Member Avatar for sj5536

how do i add multiple pane in frame dynamically that is in my frame there is one text box which take value from user when user click on ok button i have to add that much panel in jframe how do i do that ?

Member Avatar for Punit.Shah
0
5K
Member Avatar for nickecarlo

I can't figure out why I get the NullPointerException on Line 223. Would appreciate any help whatsoever. Sorry about the spacing below. Some of the code appears messy. Toggle Plain Text and it should look better. [CODE]/* Section 1: Import Statements. Imports the Scanner class and the IO Package. */ …

Member Avatar for nickecarlo
0
218
Member Avatar for jazzermonty

Hi folks So I'm developing a small game for a homework question. I have 3 classes. Apart from the main class, my drawing class draws on screen the objects for my game, like so.. [CODE] public void bat(Graphics g) { //draw the bat g.setColor(Color.ORANGE); g.fillRect(batX, batY, breadth, batLength); g.getClipBounds(); } …

Member Avatar for jazzermonty
0
98
Member Avatar for adil_bashir

can anyone tell me how to get out of the error Connection refused: connect thanks in advance

Member Avatar for adil_bashir
0
57
Member Avatar for TIM_M_91

Hi Guys well what I am trying to do is set a background image for my program where my labels, buttons , and text areas sit in front of the background. Everything I try I try I cannot get it to work. My jframe layout is below so any help …

Member Avatar for TIM_M_91
0
196
Member Avatar for desup

Hi, I am new to java and I need to work with arrays. I have found some tutorials, but everywhere was something like [CODE] int[] anArray; // allocates memory for 10 integers anArray = new int[10]; [/CODE] But what if I dont know how long the array will be? When …

Member Avatar for desup
0
154
Member Avatar for carolinatech

hey everyone, I'm trying to perform a program that will perform a leap year method and also have it to loop. here's what i have so far: import java.util.Scanner; public class LeapYear { //Create a Scanner object for keyboard input. static Scanner keyboard = new Scanner(System.in); //Set variables public static …

Member Avatar for zeroliken
0
286
Member Avatar for jinneebhat

I have a requirement to copy files from a temporary file directory to a unix file system using scp. Please provide me a sample code for this

Member Avatar for ejosiah
0
81
Member Avatar for techyworld

Can someone help me on how to draw a dynamic pie chart in java? I don't want to use jfreechart. I want to use jtable or other methods if available(but simple one) I have one but it is static.i need to write it upon user input.how can i do it? …

Member Avatar for JamesCherrill
0
364
Member Avatar for mehnihma

I am trying to cast combo box to string but I have problems with it. I get NullPointerException? [CODE] fontStyle = (String)combo.getSelectedItem(); size = (String)comboSize.getSelectedItem(); if (fontStyle.equals("Regular") && size.equals("10")) { Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 10); text.setFont(font); } [/CODE]

Member Avatar for stultuske
0
141
Member Avatar for sharvil_maniyar

run: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.sun.java.swing.plaf.nimbus.NimbusStyle.init(NimbusStyle.java:418) at com.sun.java.swing.plaf.nimbus.NimbusStyle.validate(NimbusStyle.java:359) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getValues(NimbusStyle.java:927) at com.sun.java.swing.plaf.nimbus.NimbusStyle.getInsets(NimbusStyle.java:605) at javax.swing.plaf.synth.SynthStyle.installDefaults(SynthStyle.java:896) at javax.swing.plaf.synth.SynthLookAndFeel.updateStyle(SynthLookAndFeel.java:275) at javax.swing.plaf.synth.SynthLabelUI.updateStyle(SynthLabelUI.java:53) at javax.swing.plaf.synth.SynthLabelUI.propertyChange(SynthLabelUI.java:232) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276) at java.awt.Component.firePropertyChange(Component.java:8128) at java.awt.Component.setName(Component.java:935) at javax.swing.plaf.synth.SynthComboBoxUI$SynthComboBoxRenderer.getListCellRendererComponent(SynthComboBoxUI.java:409) at javax.swing.plaf.basic.BasicComboBoxUI.getDisplaySize(BasicComboBoxUI.java:1334) at javax.swing.plaf.basic.BasicComboBoxUI.getMinimumSize(BasicComboBoxUI.java:903) at javax.swing.plaf.basic.BasicComboBoxUI.getPreferredSize(BasicComboBoxUI.java:892) at javax.swing.JComponent.getPreferredSize(JComponent.java:1634) at javax.swing.GroupLayout$ComponentSpring.calculateNonlinkedPreferredSize(GroupLayout.java:2944) at javax.swing.GroupLayout$ComponentSpring.calculateNonlinkedMinimumSize(GroupLayout.java:2930) at javax.swing.GroupLayout$ComponentSpring.calculateMinimumSize(GroupLayout.java:2897) at javax.swing.GroupLayout$Spring.getMinimumSize(GroupLayout.java:1315) at javax.swing.GroupLayout$ComponentSpring.calculatePreferredSize(GroupLayout.java:2904) …

Member Avatar for JamesCherrill
0
809
Member Avatar for ringo_tech

hi i have another network problem! when i close the socket in server side or the client side i get connection reset exception and then i'm not able to reconnect without resetting the server then start the client again, so how can i close a socket and reconnect without resetting …

Member Avatar for RicardoE
0
83
Member Avatar for ujjwale
Member Avatar for stultuske
0
126
Member Avatar for MozammilK

Hi, i have the following code in Java as you can see there are a lot of code repetition. I want to know how i can loop this part of code instead of writing it each time? [CODE] g.setColor( Color.black ); g.fillArc( 110, 80, 300, 300, 0, valint[0] ); g.drawString("BMW", …

Member Avatar for stultuske
0
128
Member Avatar for riahc3

What is the best way to start/stop/restart Apache Tomcat using Java code? If it cant be platform dependent (or complicated or I have to do a "IF" for each), then only for Windows. Thanks

Member Avatar for RicardoE
0
253
Member Avatar for Gnawk

Hi the project i have is Write a program that displays diamonds as text using a character provided by the user. For example, a diamond of height 6 constructed from asterisks will display as follows: __* _*** ***** ***** _*** __* (I cant make it line up perfectly... ) after …

Member Avatar for Gnawk
0
335
Member Avatar for vuquanghoang

I do the program to practice what I have learned in a class at my university(convert input of infix form to post fix one), but my program doesn't run correctly. Please help my to find out my bug. == IntoPost class /* * To change this template, choose Tools | …

Member Avatar for vuquanghoang
0
201
Member Avatar for nickecarlo

I have the following piece of code. I do not understand why its not working. I'd really appreciate help on this. [CODE]import java.util.Scanner; import java.io.*; class ReadFiles { String [] codes = new String[99]; int i = 0; private Scanner readCodes; public void openCodesFile() { try { readCodes = new …

Member Avatar for nickecarlo
0
10K
Member Avatar for Gnawk

This is just a part of a program When my code asks me Enter diamond size ("short", "average", or "tall"): how do i make it so that if i don't put anything and press enter it asks me exactly same questions again?? i tried putting input.length() == 0 or input.equals("") …

Member Avatar for Gnawk
0
81
Member Avatar for mjacqu4

Hey, I'm trying to store data in a record store then sort it, but I'm getting weird results when I try to add anything to the recordstore object... I was using a for loop to add records, and I noticed that the recordStore contained way more records than I added. …

Member Avatar for mjacqu4
0
94

The End.