35,618 Topics
![]() | |
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 … | |
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; … | |
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 … | |
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", "* *","* *","* *", "* *", "* *","*", "* *","* *","* *","* … | |
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() … | |
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!! | |
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 | |
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 … | |
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 … | |
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 … | |
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 ? | |
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. */ … | |
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(); } … | |
can anyone tell me how to get out of the error Connection refused: connect thanks in advance | |
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 … | |
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 … | |
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 … | |
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 | |
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? … | |
![]() | 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] |
![]() | 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) … |
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 … | |
Guys can any one help me in JAVA? how does it help in making softwares? | |
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", … | |
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 | |
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 … | |
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 | … | |
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 … | |
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("") … | |
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. … |
The End.