32,199 Topics
| |
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 … | |
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 … | |
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 | |
[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" + … | |
[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 … | |
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, … | |
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 … | |
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 … | |
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); … | |
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 … | |
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 … | |
hello friend i want to change arabic or farsi alphabet convert into unicode so plzz give hints | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
I wish to make a project on Messenger using Java. But is [B]Java Socket programming[/B] necessary for it? | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; … | |
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; … | |
[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 { … | |
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 … | |
[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 … | |
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 … |
The End.