32,199 Topics

Member Avatar for
Member Avatar for chiiqui

I am once again experimenting and Only to find out that java is pass by value, how do I actually manipulate a method or an array that has been pass to another method? for example [CODE]int[]a ={1,2,3,4,5,6}; modify(a); ________________________ void modify(int[] aTest){ aTest[1]=2; }[/CODE] //take note that those arrays are …

Member Avatar for JamesCherrill
0
248
Member Avatar for rajhans

Hello All, I have stuck in a problem. There are set of strings of different length. I have to remove repeated elements from all the strings except from the string in which it appeared first. For example say the input strings are "3 4 7 2 15 10" "5 7 …

Member Avatar for rajhans
0
207
Member Avatar for sidra 100

m a begineer of java programing plz tel me wats wrong in my program. [CODE]// my first program public class HelloWorld { public static void main(String[] args) { System.out.printIn("Hello World"); } }[/CODE] it shows the error cannot find symbol. symbol:method PrintIn(java.lang.string) location: class java.io.printstream system.out.printIn("helloWorld") 1 error

Member Avatar for vijaykavin10
0
94
Member Avatar for eziekiel123

[CODE]import java.util.*; public class scwhile{ static Scanner input = new Scanner (System.in); public static void main (String[] args) { char letter; String inputMessage; String inputString; String outputMessage; inputMessage = "Program to convert uppercase " + "letters to their corresponding "+ "telephone digits.\n" + "To stop the program enter #.\n" + …

Member Avatar for JamesCherrill
0
233
Member Avatar for gahhon

[CODE] public class Rectangle { private double length; private double breadth; public void Rectangle(){} [COLOR="Green"]public Rectangle(double length, double breadth){[/COLOR] this.length = length; this.breadth = breadth; } public void setLength(double length){ this.length = length; } public double getLength(){ return length; } public void setBreadth(double breadth){ this.breadth = breadth; } public double …

Member Avatar for ~s.o.s~
0
121
Member Avatar for nick6987

we given a program department program which user enters a number to a specific department and now our teacher wants us to convert that to a switch and use enum data type having a little trouble with some of the errors. [CODE]import java.util.Scanner; enum MenuOptions currentPrompt { BILLING, FORECLOSURE, LISTING, …

Member Avatar for stultuske
0
148
Member Avatar for WDrago

All, I can't seem to find anything on the web about how to connect to a LibreOffice database. I am currently using the following code to connect to a MS Access database and would like to know how to change it to work with LibreOffice. [CODE]String strConnect = "jdbc:odbc:DRIVER=Microsoft Access …

Member Avatar for WDrago
0
3K
Member Avatar for rotten69

Hey everyone, I have been looking for video tutorials on SWING class and pretty much of GUI side in Java .. I found tutorials on Oracle site but they require lots and lots of reading.. if anyone knows a good site that has videos on GUI, please share it.. Time …

Member Avatar for ceyezumma
0
427
Member Avatar for StephNicolaou

Hi all, Trying to simply call method, (below) from another class and return the value found by the scanner. Please see below: [code] public int getInt(String prompt) { System.out.print(prompt + "a"); //int result = in.nextInt(); if (in.hasNextInt()) { x = in.nextInt(); y = in.nextInt(); sum = x+y; System.out.print("sum" + sum); …

Member Avatar for StephNicolaou
0
147
Member Avatar for Laxman2809

So I have been tasked with creating a program that is essentially a planner for a person. It has to have the abilities to add events of 3 types(Party, Dance Class,Club Meeting). It then has to be able to display everything enter, and be able to display the things that …

Member Avatar for stultuske
0
119
Member Avatar for Neversleepin

Hi all, Here is what i found with google to Find and Replace word in Java: [CODE] public class ReplaceAll { public static void main(String[] args) { String str="We want replace replace word from this string"; str=str.replaceAll("replace", "Done"); System.out.println(str); } }[/CODE] It works well but how to do the same …

Member Avatar for stultuske
0
1K
Member Avatar for 2k9-it

hello friend i want to change arabic or farsi alphabet convert into unicode so plzz give hints

Member Avatar for stultuske
0
76
Member Avatar for AQWst

I am new to GUI Java programming and I am attempting to find the best way of creating a frame to contain a series of menus. I am first adding logic to have the date and time appear in the frame, but the way I am doing it they are …

Member Avatar for stultuske
0
418
Member Avatar for Dersev

Hello I have a small problem with ListSelectionListener. I can not copy dataList.getSelectedValue().toString(); to global String variable text. How can I do it ? This is inside of if statement and that is the problem. Anyone knows how to solve it ? [CODE] ListSelectionListener lListener = new ListSelectionListener() { public …

Member Avatar for mKorbel
0
317
Member Avatar for ceyesuma

Hello all. In my Apache derby db I set up Decimal data types like this: [code] admin_pay_rate DECIMAL(5,2), [/code] I use JFormattedTextFields to filter decimal usage in text fields concerning money Like admin pay rate would be 150.00: this is good. In the JFormattedTextField it will allow 1,000.00 but the …

Member Avatar for mKorbel
0
206
Member Avatar for zaxon1987

Okay so basically I'm studying Introductory programming using the 'BlueJ' Java program on Mac. I'm trying to create a 'Dynamic Billboard' program that asks a user to enter a five letter word using the letters; ' S, P, A, R, E', then displays it in white on a black screen …

Member Avatar for JamesCherrill
0
220
Member Avatar for vijaykavin10

In applet we are using init() method so inside of the init() method can we use the actionPerformed method or can't?.If we couldn't which place can be implements that action performend method. Also you just give me the syntax for creating the actionperformed method in applet.And that applet must have …

Member Avatar for mKorbel
0
146
Member Avatar for Nathan_11

I have this code that would randomize the number inputs but should not include 0 and 50 and above digits... how should i do it? Thanks [CODE]import java.util.*; public class RndomA { public static void main(String[]args){ int[]A=new int [10]; Scanner in=new Scanner(System.in); System.out.println("Numbers to be randomize:"); for(int a=0;a<A.length;a++){ Random r=new …

Member Avatar for stultuske
0
138
Member Avatar for Onlineshade

I wish to make a project on Messenger using Java. But is [B]Java Socket programming[/B] necessary for it?

Member Avatar for stultuske
0
80
Member Avatar for solarmotion

I had encounter a problem in my task. How come the output always return false? [CODE] public class Entity { private String itemCode; private String title; private String description; private int language; private int time; private String productCompany; private int status; public Entity(){ itemCode="E250"; title="The Lookout"; description="by Scott Frank"; language=1; …

Member Avatar for solarmotion
0
113
Member Avatar for crazybeaner

I'm creating an odometer program. "The problem to solve is define a class Odometer that will be used to track fueland mileage for an automobile. The class should have member variables to track the miles driven and the fuel efficiency of the vehicle in miles per gallon. Include a mutator …

Member Avatar for javaAddict
0
371
Member Avatar for ynwa

Hi, I am currently using swt-win.jar on my 64 bit Windows Operating system. The error i am facing is that the the following Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM Is there any swt jar file for 64 bit windows operating system and 64 …

Member Avatar for ~s.o.s~
0
62
Member Avatar for newbie14

Dear All, I have a snippet of code as below. Here I build one db connection and is shared across. I can put the dbconn.commit in place and no problem. The problem when I put the dbconn.rollback I get this sort of error "commServer.java:1798: unreported exception java.sql.SQLException; must be caught …

Member Avatar for newbie14
0
245
Member Avatar for Acidburn

hey guys I'm trying to get hold of a StreamConnection [code] try { StreamConnection conn = ( StreamConnection ) Connector.open ( url ) ; } catch (Exception ex) { ex.printStackTrace(); } [/code] however when i do this i get the following error [quote] java.lang.ClassCastException [/quote] According to my know of …

Member Avatar for Bens
0
162
Member Avatar for lbgladson

I have a program to add coins into a piggy bank and calculate the total but my program is not asking how many of each coin and will not give me the total. [code] import java.util.Scanner; public class PiggyBankTester { public static void main(String[] args) { int pennies; int nickels; …

Member Avatar for sirlink99
0
1K
Member Avatar for lbgladson

I have an assignment to gather information on students and their grades and then display the information using a for loop. I have the following code but it is not displaying the information correctly. Any help would be great. [code] public class Grader { String last; String assign; int score; …

Member Avatar for Slimmy
0
151
Member Avatar for buba_kazouba

[CODE]package amena; import java.awt.Color; /** * FileSystemModel is a TreeTableModel representing a hierarchical file * system. Nodes in the FileSystemModel are FileNodes which, when they * are directory nodes, cache their children to avoid repeatedly querying * the real file system. */ public class FileSystemModel extends AbstractTreeTableModel implements TreeTableModel { …

Member Avatar for Slimmy
0
226
Member Avatar for lbgladson

I have an assignment an I have been looking at it for a while now but really have no idea what I should be doing. I have included the code I have written but is will only print out He and not the entire phrase. Write a program that reads …

Member Avatar for lbgladson
0
355
Member Avatar for kurohige

[CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class controlBall extends JFrame { private JButton jbtRight = new JButton("Right"); private JButton jbtLeft = new JButton("Left"); private BallCanvas canvas = new BallCanvas(); public controlBall(){ JPanel panel = new JPanel();//use the panel to group buttons panel.add(jbtLeft); panel.add(jbtRight); this.add(canvas, BorderLayout.CENTER);//add canvas to the center …

Member Avatar for kurohige
0
2K
Member Avatar for jaykool74

Using NetBeans IDE 7.0.1 with Java SDK 1.7.1 and Glassfish 3.x: I am trying to load an ArrayList from a database in the Servlet to be used on the JSP page in a dropdown box that would show stock symbol and company name. I get the following message when trying …

Member Avatar for jaykool74
0
5K

The End.