32,204 Topics

Member Avatar for
Member Avatar for kchadek

Wrote this program to find if 2 phrases are Anagrams of one another. Works except that I need to make it ignore any other character than letters(including spaces) As is now I get 4 errors, all in that last boolean 1&2: cannot find symbols for phrase1/2.length (tried anag.phrase and didnt …

Member Avatar for kchadek
0
166
Member Avatar for adanaz

Hi guys I'm trying to take a user input (name) and replicate the input in other methods. Can anybody help? Here is the code: [CODE]import javax.swing.JOptionPane; public class example { public static void main (String[]args) { entername(); } public static void entername() { String a=""; a = JOptionPane.showInputDialog("Welcome. Enter name …

Member Avatar for adanaz
0
960
Member Avatar for rowley4

I do not want to have my box this wide. I would like the text to wrap but I do not know how. Can I do this? I'd like my box to be 400,400 rather than 1250,200, but it is the only way I can get my text to fit. …

Member Avatar for quuba
0
620
Member Avatar for lse123

How in Java SE and EE(Web), I may program in a form, a drop down menu and same time itself be a textbox user can type in?

Member Avatar for kramerd
0
69
Member Avatar for speedkreature

This is my second day with Java. So far, I'm enjoying it quite a bit. It has the structure of C++ that I like, and with so much more utility (lots of type conversion built in)! I've written a console program that allows a user to input text. That text …

Member Avatar for Ezzaral
0
310
Member Avatar for LianaN

Hi! How could I create/delete a directory on the remote machine using FTPClient of org.apache.commons.net.ftp.*; ? The code used to save a file on the remote machine is shown below. But I would like to update it for creating/deleting directories. Thanks! [CODE] private void saveAttachedFileToRemoteMachine(String pathToFile, DefaultMutableTreeNode selectedNode) { FTPClient …

Member Avatar for LianaN
0
937
Member Avatar for LianaN

Hi! I would like to get an advise about the following question. There is a set of text fields. The task is to generate a new JFrame and align text fields based on the information given, i.e. a row and column of each text field. Let's say there is a …

Member Avatar for LianaN
0
185
Member Avatar for spring_patel

hello, i'm vasant...recently visited an online tutorial for creating java desktop database application here is the URL [url]http://www.netbeans.org/kb/docs/java/gui-db.html#running-outside-IDE[/url] ... everything works fine...when building and executing the application from within the NetBeans IDE..6.7 but as instructed in that tutorial...when I tried to run the .jar file after exiting the netbeans IDE, …

Member Avatar for Ezzaral
0
161
Member Avatar for StaticX

Hello, I am having some trouble with getting my menu to respond to a mouse click.I have 2 items on my menu, "New" and "Exit", and they are using the actionlistner like so [CODE] newFromMenu = new JMenuItem("New Screen"); newFromMenu.addActionListener(this); [/CODE] and then my action event [CODE] public void actionPerformed(ActionEvent …

Member Avatar for StaticX
0
66
Member Avatar for mani_1991

hai, friends i have problem in inserting image into mysql database using a small java program.... here is my code for inserting image into database............ [CODE] import java.io.*; import java.sql.*; class ImageUpload { public static void connection() { Connection con=null; Statement st=null; PreparedStatement pst=null; try { Class.forName("com.mysql.jdbc.Driver"); System.out.println("driver is loaded"); …

Member Avatar for SasseMan
0
242
Member Avatar for deniseblue

I am doing a inventory assignment, I think I have completed the code, but when I try to run it I get <no main classes found> I am using NetBean IDE 6.9.1 It also tells me: Created dir: C:\Users\marilyn\Documents\NetBeansProjects\ClassPublicPayroll\InventoryPart1\dist Not copying the libraries. Building jar: C:\Users\marilyn\Documents\NetBeansProjects\ClassPublicPayroll\InventoryPart1\dist\InventoryPart1.jar To run this application …

Member Avatar for apines
0
229
Member Avatar for fahadyousaf

program is working fine on YES option but on NO option it does not return ? any one give me hint ?? this.addWindowListener(new WinAdapter(){ public void windowClosing(WindowEvent e){ String cnic1 = (String)cnic.getValue(); String name1 = name.getText(); String fname1 = fname.getText(); String age1 = (String)age.getValue(); String add1 = add.getText(); String pro1 …

Member Avatar for JamesCherrill
0
127
Member Avatar for Buffalo101

Hey guys, I'm trying to code a testing app which will display questions on a JForm for a period of time. I need a way of keeping track of time so I know when the user's time is up. What should I use? So far, I've found these: [B]javax.swing.Timer[/B] [B]java.util.Timer …

Member Avatar for Buffalo101
0
1K
Member Avatar for muncher10

i need to move[CODE]if(fright <= 45 && fright >= 35) System.out.println("Pressure is in range"); else System.out.println("Warning: Front right tire pressure is out of range"); [/CODE] to TirePressure but have it still print out right after i imput the tires pressure not after i imput them all and i cant figure …

Member Avatar for jon.kiparsky
0
88
Member Avatar for ivanhuk

For a homework assignment I need to make a stoplight cycle from red to green to yellow back to red. I tried using a thread.sleep method when I press a button to cycle through but it only goes to the last sleep & setColor statement. I know this is probably …

Member Avatar for JamesCherrill
0
162
Member Avatar for LianaN
Member Avatar for LianaN
0
114
Member Avatar for Barnifericus

Okay so in class my professor was going over this code: [CODE]class BinaryTreeNode<T> { protected T element; protected BinaryTreeNode <T> left, right; BinaryTreeNode (T obj) { element = obj; left = null; right = null; } // constructor BinaryTreeNode public int numChildren() { int children = 0; if (left != …

Member Avatar for sharathg.satya
0
251
Member Avatar for asif786

I have a compilation error using bluej java. Here is the code: [CODE]while input.equals(!"q")[/CODE] This is the error I get: '(' Could you please help me thanks :) If i add to a semicolon to the end like this: [CODE] while input.equals(!"q");[/CODE] I still get the same error.

Member Avatar for asif786
0
111
Member Avatar for javaperson1

Hi there, I tried to to delete sorted number in each rows by reading a text file and write it to another file with a new format: such as readfile1.text contains 1, thoman 2, tom 3, jess87 4, kelly and so on.. I came up with this code and I …

Member Avatar for javaAddict
0
149
Member Avatar for musikluver4

I have been able to successfully load another java program (Calculator) within a java program with the following code: [CODE]Calculator.main(null)[/CODE] The program loads successfully but both programs have the code: [CODE]addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } );[/CODE] So once I close the Calculator program …

Member Avatar for JamesCherrill
0
126
Member Avatar for fahadyousaf

Please any one guide me or give me some hint ... can i run my java application directly from batch file or any other way from which i can directly access GUI of application. Regards,

Member Avatar for apines
0
102
Member Avatar for blknmld69

I have started my code to create an application with two combo boxes. One that holds the names of the dormitories and the other holds the meal plans. The user should select a dormitory and a meal plan, and the application should show the total charges for the semester. I …

Member Avatar for jon.kiparsky
0
904
Member Avatar for musikluver4

I have a GUI program that controls all the graphics, etc of the program, while another program has all the calculations the GUI program grabs to show in its program. Well I would like to have another program that uses Frame and implements ActionListener, and launch that program with the …

Member Avatar for musikluver4
0
134
Member Avatar for hwalsh

Can anybody tell me why I'm not getting checkboxes? Sometimes I can get one, but never the three I need. [CODE]public class SwingLab implements ActionListener { // instance variables - this instance will get reader's name private Scanner reader;//name from user private Random random; private ArrayList<String> name;//construct a responder, declare …

Member Avatar for hwalsh
0
166
Member Avatar for Tankadin

Hi folks I know this particular program has been posted in many other forums but it all involves many different things that I have no learned yet so I really can't use any of them.....plus it would make me look stupid to turn in something that I copied that includes …

Member Avatar for Tankadin
0
5K
Member Avatar for sariberri

I'm trying to figure out how to add an element to an array of integers, but the tricky part is that I have to slide the elements to the right of it over by one place. For example: Start array: {1, 2, 3, 4, 5, 6, 7} Adding 10 to …

Member Avatar for Ezzaral
0
138
Member Avatar for sciprog1

Hello, I have a Client/Server program. The Server is BlackJackServer.java. I am having the following exception when I run the program. Can anyone explain me what the error below is saying? [CODE]java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.DataOutputStream.write(DataOutputStream.java:90) at java.io.DataOutputStream.writeUTF(DataOutputStream.java:384) …

Member Avatar for Ezzaral
0
168
Member Avatar for winner126

I'm trying to implement a chatroom using RMI and everything was fine until I tried to bring my GUI into the picture, from what I can see the RMI aspect is fine, the client is sending the info to the server, the server sends it to all clients with callback. …

Member Avatar for Ezzaral
0
356
Member Avatar for LianaN

Hello! I have a JScrollPane with JTable that is filled from MySQL. I'm using SwingWorker to display JScrollPane while reading data from MySQL database. There is no problem with it. My question is how to add a text "Loading..." to JScrollPanel? I just want to display some message in this …

Member Avatar for LianaN
0
4K
Member Avatar for falkor15

The problem states to write a method named fallingDistance that accepts an object's falling time as an argument. The method should return the distance that the object has fallen during the time interval. Demonstrate the method by calling it in a loop that passes the values 1-10 as arguments and …

Member Avatar for falkor15
0
668

The End.