32,199 Topics

Member Avatar for
Member Avatar for lameraz

GUI class with the list. What i want to do is have another class add to this list when button is clicked but im not sure how to do that. [CODE] public class LView extends MasterViewPanel{ private static final long serialVersionUID = 1L; private JButton host, join, quit, start; private …

Member Avatar for lameraz
0
169
Member Avatar for twinkle2011

Guys I need some help in my activity, I'm making a calculator using NetBeans but I dont know what codes to use be in 0,1,2,3,4,5,6,7,8,9,+,-,*,/,=,(. decimal) all i know is the clear button code[CODE]private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){ jTextField1.setText(""); } [/CODE] My calculator lack of functionality...:(

Member Avatar for twinkle2011
0
109
Member Avatar for kyriacos1986

I have been asked to create to check if a word is palindrome or not. But I am facing some problems. After the code you can see the messages that I received from the compiler. [CODE] import java.util.*; public class Palindrome { public static void main(String[] args) { [B]Stack<String> stack …

Member Avatar for kyriacos1986
0
2K
Member Avatar for vinithktp

Hi, I am facing OutOfMemory exception in Java, Kindly help me to resolve this issue, really appreciate your help [U][B]ERROR: [/B][/U]java.lang.OutOfMemoryError: Java heap space [B][U]CODE:[/U][/B] [CODE] public Blob getBlob(String databaseInstance, InputStream inputStream) throws SQLException, Exception { applog.info("Entering getBlob"); InputStream stream = null; applog.info("inputStream : " + inputStream); stream = inputStream; …

Member Avatar for vinithktp
0
900
Member Avatar for upanotch

I'm trying to make my first real project: A calculator, but when I press the "clear" button (the only button i've done so far) the JLabel doesn't go from two to zero, any help would be really appreciated :) code: [CODE]import java.awt.Color; import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; public class …

Member Avatar for stultuske
0
134
Member Avatar for umair jameel

I am a beginner in programming(java) and want to know, how to do typecasting in it. show me by giving examples.

Member Avatar for stultuske
0
125
Member Avatar for MisterRaver

Hi, I am wondering if it is possible to "transfer" a Socket connection to another ServerSocket? So, say I listen for a connection on ServerSocket with port 1111. A connection is established, I know want to use a ServerSocket with port 2222 to handle this connection. Is he possible without …

Member Avatar for MisterRaver
0
258
Member Avatar for riahc3

Hey Im currently working on a application server written in Java but to use information from a C++ program. The company seems to agree that rewriting thousands of lines of code would be time consuming and simply making libraries of key functions of the C++ program and then passing them …

Member Avatar for riahc3
0
2K
Member Avatar for umair jameel

How to convert int value to another data type in java or from other data types to int.I just need syntax of it.

Member Avatar for JamesCherrill
0
75
Member Avatar for Labdabeta

I accidentally hit Source->Externalize Strings... on eclipse and now hundreds of string literals are stored in a properties file. I want them back scattered about my code. How can I do this without re-entering them?

Member Avatar for JamesCherrill
0
157
Member Avatar for poojavb

I need a help to understand what condition can be applied to the below requirement: If suppose we have 2 species name eg. dog and cat... and we have few breed name for the above mentioned species.... so what condition can be applied in such a way that the user …

Member Avatar for niranga
0
174
Member Avatar for asif49

I have to complete a project about employees and their jobs. Here are the requirements: 1 Must be able to add new employees 2 Must be able to add new jobs 3 Must be able to attach a registered employee to registered jobs (several jobs to the same employee) Since …

Member Avatar for stultuske
0
86
Member Avatar for Matth963
Member Avatar for Matth963

[CODE]int numdigits(int num){ int len = 0; while(num >= 10){ num = num/10; len++; } return len; } [/CODE] This algorithm is used to count the number of digits but I can't understand it. Someone explain it to me please :D Thanks

Member Avatar for hfx642
0
103
Member Avatar for jaxi

For a program I'm writing, I'm trying to get rid of doubles in my string (which is a concatenation of a keyword and the alphabet). My code was compiling fine until I added the code about concatenating the substrings before and after the character I'm trying to get rid of. …

Member Avatar for NormR1
0
202
Member Avatar for DaniwebOS

Can you guys run this program, I'm having issues running it. [ICODE]import java.io.*; import java.util.*; //class definition public class NumberAdder { //The main function public static void main(String args[]) { //This declares a file to open. File outFile = new File("numbers.dat"); int sumEven = 0; int sumOdd = 0; //File …

Member Avatar for NormR1
0
452
Member Avatar for Jade4127

I am confused about composition in java. I am able to write code using inheritance...but have no idea how to turn it into composition...from what my textbook said the two are quite similar has a is a relationship and all. I ultimately would like to write the cylinder code using …

Member Avatar for fausto1234
0
522
Member Avatar for begueradj

Hello people, I created an innter class like this [CODE] public class OuterClass{ int attribute=0; class InnerClass { public void method1(){ attribute++; } public void method2(){ System.out.println(attribute); } }[/CODE] My problem is when I call method2() in a correct way, it displays 0 and not 1 as I wanted. Can …

Member Avatar for JamesCherrill
0
214
Member Avatar for SeasideP

Hey i was wondering if someone could have a look at this and help me figure out why the output is repeating it's self and how I would fix it. I have spent several hours trying to fix this. Thanks in advance. [CODE]/* Author : * Date :02/10/10 * Title: …

Member Avatar for SeasideP
0
86
Member Avatar for Chaitanya Dhote

how to .class file from another package????? following is run time error when i execute like this.... [CODE] e:\java2>java employee1 Exception in thread "main" java.lang.NoClassDefFoundError: Employee1 (wrong name : com/project/employee/Employee1) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14 1) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at …

Member Avatar for peter_budo
0
113
Member Avatar for swink11123

[CODE] private int [] minValues; private int count = 0; String[] tempString ; tempString = line.split("-"); System.out.println(tempString[0]); [/CODE] but when i try to add the store into array's code, [CODE] private int [] minValues; String[] tempString ; tempString = line.split("-"); minValues[count] = tempString[0]; <-- it say incompatible types System.out.println(tempString[0]); count++; …

Member Avatar for JamesCherrill
0
103
Member Avatar for bombay1982

I would like to write a program which asks the user for a number and prints off the tree, For example 7. Program prints something like that then. If user put 3 tree will start from 3. I think you should get the idea. [CODE] "Enter a number: 7" 1 …

Member Avatar for NormR1
0
361
Member Avatar for hhheng

I'm working on a project and want to open the window to the position the same as last time the window was closed, and open the window the same size as last time was closed also. The rough script is as below: When user open the window and resize it, …

Member Avatar for harinath_2007
0
254
Member Avatar for DarkVision

Here my code [CODE] public static String modele; public static String supplier; public static int height = 180; public static final String[] COLORS = { "RED", "BLUE", "GOLD", "ORANGE", "PURPLE", "PINK", "NONE" }; public static String description; public static boolean withSnow = false; public static boolean sale = false; public …

Member Avatar for JamesCherrill
0
100
Member Avatar for gouki2005

I want to fill a Drop-downlist with a list look heres my list code [CODE] public List ListaEmpresas(){ SessionFactory factory = HibernateUtil.getSessionFactory(); Session session = factory.openSession(); Transaction transaction = null; transaction = session.beginTransaction(); Criteria crit = session.createCriteria(Empresas.class); List empresas = crit.list(); List list = new LinkedList(); // Doubly-linked list list …

Member Avatar for gouki2005
0
130
Member Avatar for bobytch

Hello everyone in this activity i should use if, else if, Boolean, for loop, do while loop ok here is the OUTPUT i must do: GRADING SYSTEM! 96-100 =1.00 94-95 =1.25 92-93 =1.50 90-91 =1.75 88-89 =2.00 86-87 =2.25 84-85 =2.50 82-83 =2.75 80-81 =3.00 78-79 =3.25 75-77 =3.50 74-below …

Member Avatar for CSloan7597
0
189
Member Avatar for Alviery

Can anybody help mi getting the area so that I display it on a message? Here is the driver: import javax.swing.JOptionPane; public class Driver { public static void main(String[] args) { Rectangle tennisCourt = new Rectangle(); { JOptionPane.showInputDialog(null," Enter Lenght: " + tennisCourt.setLength() ); JOptionPane.showInputDialog(null," Enter Lenght: " + tennisCourt.setWidth() …

Member Avatar for stultuske
0
119
Member Avatar for jeraldmuthu

[CODE] public List<SelectItem> getAnalysisList() throws ProjectContentServiceException { selectItems1.clear(); if (getTreeTable() != null && this.rootTreeNode != null) { this.rootTreeNode.accept(new TreeNodeVisitor() { public void visit(TreeTableNode node) { TreeTableUserObject obj = node.getUserObject(); if (obj.isLeaf()) { List<String> aa = new ArrayList<String>(); Map<String, Object> attributes = obj.getAttributes(); if (attributes.containsKey("selected") && ((Boolean)attributes.get("selected")) == Boolean.TRUE) { lis …

0
86
Member Avatar for pmehalik46

hi everyone. i am writing a small caeser cipher program in java for a lab is my cs class. I am sure that most of it is generally okay, but when i run the program it will not return the newly encrypted or decrypted code. Why??? is there something wong …

Member Avatar for JamesCherrill
0
726
Member Avatar for vvsjon

Google don't crawl my javascript link.. [CODE] <td><span>1</span></td><td><a href="javascript:__doPostBack('grdCompany','Page$2')">2</a> ........ [/CODE] How i crawl these link in Google??

Member Avatar for hericles
0
103

The End.