35,619 Topics

Member Avatar for
Member Avatar for stevanity

I have just started out with Java. I have been programing with C and C++ for some years now. I have this problem. Im not able to call a non static method belonging to the main class from the static main method. This is the code: [CODE]public class Helloworld { …

Member Avatar for masijade
0
28K
Member Avatar for masterofpuppets

Hey guys, Here's the problem I have: I am writing a server application in Java using the ServerSocket and Socket classes. I have an instance of ServerSocket which listens for connection and accepts them. The server runs a website that requires users to log in using an e-mail and a …

Member Avatar for masterofpuppets
0
1K
Member Avatar for sureshksk

Hi friends, I am using struts2.I have a select tag in jsp page.After submiting form to action class,again i am redirecting to same jap page. Here, In my jsp page i want to retain <s:select list="topcat_list" name="topcat_select"> options after coming back also. Is there any way.how can i do that.thnaks …

0
68
Member Avatar for 24x24

OK I have a project due tonight at midnight and I know I should have posted sooner but it seemed like such simple things that I just knew I could do it on my own. I was wrong. I need your help. I have a program that essentially makes a …

Member Avatar for NormR1
0
390
Member Avatar for Tym326

Hey guys, I am pretty new in using jsp. I am currently using tiles and action mappings for my project. I am just wondering if there is a way to use action mapping with <jsp:forward> or any other forward script, especially in tiles? I tried to do the following and …

0
106
Member Avatar for annetria

I'm receiving the following errors when trying to read from a file: java.io.FileNotFoundException: rates.txt (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:120) at java.util.Scanner.<init>(Scanner.java:636) at MortgageCalculator4.submitButtonActionPerformed(MortgageCalculator4.java:187) at MortgageCalculator4.access$000(MortgageCalculator4.java:20) at MortgageCalculator4$1.actionPerformed(MortgageCalculator4.java:70) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6288) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6053) …

Member Avatar for annetria
0
136
Member Avatar for bibiki

hey there again, I am trying to build a small mechanism that lets me store product names and prices on a produktet.txt file. the file should hold lines as follows: product1 price1 product2 price2 . . productN priceN So, I built a small panel with three rows and one column. …

Member Avatar for bibiki
0
146
Member Avatar for student.09

Hi Everyone, So I just finished writing a program from my Java class,except I can't figure out how to validate the bookID. "In the Book class, you need to provide a validate method that validate weather the book id is correct. The book id should be a [B]string[/B], which contains …

Member Avatar for benqus
0
4K
Member Avatar for quinnifir

I have been recently working on a java project to just practice java and work on making programs for fun, but i came up upon this bug: When i use Thread.sleep on my java program, it doesent execute the line above the try-catch block where i have my Thread.sleep. heres …

Member Avatar for JamesCherrill
0
137
Member Avatar for 9Nimo4

How would I get a box to appear when I hover over a JLabel? The box is to explain what the label is. This is just a minor detail for the user-interface functionality of a game. So when a user hovers over a label, a box appears explaining it.

Member Avatar for JamesCherrill
0
542
Member Avatar for collizz

Hi Can someone please let me know which classes, objects, etc I should use into to convert an image file (.png, probably) to a printable string in Java? The image will be around 100px square and I presume I could scan 1px lines into arrays, etc? I'm hoping Java has …

Member Avatar for NormR1
0
243
Member Avatar for Sadun89

Dear Friend..... I want to make web site that it want to plugging with facebook..... In other words, If i type & submit something,I want to publish in Facebook wall (if i can publish in selected person's walls its very worth) it like what the youtube done after some video …

Member Avatar for Sadun89
0
282
Member Avatar for chetanbasuray

I was planning to start with a java speech program and went on with some research across the internet. I found that for any such program I need an API called the java Speech API. However when I wrote down import java.speech it showed no existence of any such API. …

Member Avatar for techstu123
0
202
Member Avatar for himmat.m4

Hi, In our application there is we have made connection code on jsp page. that code working properly but if we press long time F5 key then we get Exception is as followes : - "java.sql.SQLException: ORA-00942: table or view does not exist" after that if we press one time …

0
45
Member Avatar for khaled_jawaher

i have created a war file and save it in tomcat/webapps folder.this war file contains the code of the server that will read xml file and return it as table in a Jframe.i coded it in java and it is a web service where i create a war file after …

Member Avatar for khaled_jawaher
0
270
Member Avatar for b0tz

[CODE] String ip = "www.google.ro"; String pingResult = ""; String pingCmd = "ping " + ip + " -c 4"; String s; try { Process p = Runtime.getRuntime().exec(pingCmd); BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream())); // read the output from the command System.out.println("Rezultat ping:\n"); for …

Member Avatar for b0tz
0
224
Member Avatar for ARaza110

I am using the Comm API, i have made a small desktop app for sending sms. I cannot send sms one after the other since it gives "Port In Use Exception". I have closed the Input and output streams as well as the serial port but still it gives "Port …

Member Avatar for ARaza110
0
168
Member Avatar for syeda amna

hi please help me to develop code for JTextField exception handling. i have 10 JTextFields out of which 2 are necessary to fill. if the user left them blank then error message will appear. [CODE]try{ text1=a.getText(); text2=b.getText(); while(a!= null && b!=null);} catch(Exception e){ System.out.println("Please write some text" +e.getMessage());} [/CODE] this …

Member Avatar for Buffalo101
0
2K
Member Avatar for autorunman22

im a newbie and im learning java just week ago. I wonder how i cant make the ball bounce in one axis only (the X axis) im not good in logic:( and i want that logic to be in one event. [code]if(x<0){ ++x;//go right }else if(x>500) {--x;//go left } [/code] …

Member Avatar for autorunman22
0
164
Member Avatar for AhmedGhazey

hello, i ask for help if you can : i have to write algorithm detect all cycles in undirected graph , I don't know , can any one help. Thanks .

Member Avatar for AhmedGhazey
0
839
Member Avatar for niranga

Hi All, Is it possible to bind an array or a Vector with a event listener? For an example if we add an element to the Vector or remove from the Vector, can I use an event listener to track the changes? Thanks a lot in advance. Cheers..!!

Member Avatar for niranga
0
998
Member Avatar for mindbend

So I'm busy with a small website I'm able to login at the website with the help of sessions that all goes well. But I'd like to expand the website a bit more, it's a sport website where people can add players, add teams, and add matches, and those are …

Member Avatar for mindbend
0
459
Member Avatar for winecoding

I am learning Java, and found a code segment as follows. [CODE]public static void displayClusters(final Collection<Cluster> clusters) { displayClusters(clusters, Integer.MAX_VALUE); } public static void displayClusters(final Collection<Cluster> clusters, int maxNumberOfDocumentsToShow) { displayClusters(clusters, maxNumberOfDocumentsToShow, ClusterDetailsFormatter.INSTANCE); } public static void displayClusters(final Collection<Cluster> clusters, int maxNumberOfDocumentsToShow, ClusterDetailsFormatter clusterDetailsFormatter) { System.out.println("\n\nCreated " + clusters.size() + …

Member Avatar for JamesCherrill
0
148
Member Avatar for AnkitKumar
Member Avatar for arvindikchari

Hello, I have a string taken as input from user. I just want to check if a particular character within that string, is part of Standard English character set or not. How do I code the IF condition for this purpose? Regards, Arvind.

Member Avatar for AhmedGhazey
0
173
Member Avatar for autorunman22

i hope you can modify my simple bouncing ball :( its flickering.... i dont know how to solve it. [CODE]import javax.swing.*; // For JPanel, etc. import java.awt.*; // For Graphics, etc. import java.awt.event.*; import java.awt.geom.*; // For Ellipse2D, etc. //import java.util.*; import java.io.*; import java.util.Random; public class aball extends JFrame …

Member Avatar for hfx642
0
206
Member Avatar for tultul

hello... everyone! i have included graphics over Map like a popup menu, but now i need to provide a mouse click action over the graphic. Is it possible...?? let me explain properly. i have given city details over open street maps by using graphics2D, now i need to give a …

Member Avatar for peter_budo
0
134
Member Avatar for joao cruz

hi everybody, i'm a student and i'm sick of going around this. lol i have to make a game of tic tac toe, and i did everything, and everything is working fine exept this. this is a method to see if there is a victory in a line, it does …

Member Avatar for joao cruz
0
97
Member Avatar for AnkitKumar
Member Avatar for mastr924

In the listener for a button in the actionPerformed(ActionEvent e) part, if you call e.getSource it returns a type object. So how can I turn that object that it returns into the original button?

Member Avatar for Leeibra
0
615
Member Avatar for dashby

I have a bmi application that was written in Java via netbeans but now I am trying to convert the Java to C#, I have pasted a sample of my Java and under that what I have so far for my C#. I would be grateful for some help with …

Member Avatar for dashby
0
184
Member Avatar for bibiki

hi again, I think I installed Java 3d correctly... I can compile code, but the code won't run. this is the error I am getting: [QUOTE] # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0949c964, pid=3832, tid=3604 # # JRE …

Member Avatar for bibiki
0
163
Member Avatar for pxndx

ok so i have a project for school, and i finished so the teacher wants it to read for a .dat the parameters for the java class here is what i got: [CODE]public void cargarCurso(){ try{ BufferedReader fileIn = new BufferedReader( new FileReader("c:/cursoSem2.dat")); String dataRenglon = fileIn.readLine(); while(dataRenglon !=null){ StringTokenizer …

Member Avatar for pxndx
0
236
Member Avatar for manaila

Hi I have always seen many softwares having a customized look, for example, PuTTY software has two computers icons in a network. Others, such as NetBeans IDE, when double-clicked first show some sort of a window before showing a real software environment. So I am just curious about how this …

Member Avatar for JamesCherrill
0
109
Member Avatar for AnkitKumar
Member Avatar for AnkitKumar
Member Avatar for kukuruku

Hi ,I am trying to implement stack with linked list ,but when I run it show up NullPointerException How can I avoid that with try and catch Thanks [CODE]public char pop() { try{ ListNode returnNode = top; top = top.next; } catch (Exception e){} return returnNode.value; }[/CODE]

Member Avatar for jon.kiparsky
0
329
Member Avatar for aksahoo17

Hello, Can anybody help me for connection to multiple database dynamically. Its means I wann to connect the respective database by choosing of the user , Tell take an exmple we have 3 clients namely C1,C2,C3 and having respective databases namely D1,D2,D3. I want to connect the database D1 if …

Member Avatar for aksahoo17
0
120
Member Avatar for shoeson

Hi i am trying to use Java for a video conferencing [B]web application.[/B] I am having trouble finding an appropriate framework which enables capturing webcam video in a web page. Could you help me out if you have had similar experience. I guess applets can be used but some recommended …

0
57
Member Avatar for sirlink99

I have a check button and I was wondering how to get the value from it. When I use this code it gives me that it is selected always, even when it is not. [CODE] public void itemStateChanged(ItemEvent e) { // TODO Auto-generated method stub JCheckBox sourceBox = ((JCheckBox)e.getSource()); wave1Invert …

Member Avatar for sirlink99
0
122
Member Avatar for StormHawk

Hello experts! I've made a GUI that calculates the surface area and volume of several shapes based on User input of discreet information such as length, width, depth, etc. [IMG]http://i246.photobucket.com/albums/gg88/mustardy85/ScreenShotGUI.png[/IMG] _______________________________________________________________________________________________________ How do I get java to draw the shapes of images in the BLUE rectangle to the right of …

Member Avatar for NormR1
0
155
Member Avatar for JSpudMonkey

Hey guys, i made a program that calculates a heat index for a area. User inputs humidity, tells actualy temeperaute. But when i compile it, it says i havea syntax error at the Scanner Input = new Scanner(System.in) line? why is that?[code]public class HeatIndexCalculator { private static final double c1 …

Member Avatar for NormR1
0
282
Member Avatar for AhmedGhazey

SA : I ask if anyone can help me in this algorithm , it is suppose that this algorithm find all the cycles in given graph . but there exist a bug it return only one cycle not all : [CODE]public class Main { public boolean funcs(boolean Graph[][]){ ArrayList<ArrayList<Integer>>l=new ArrayList<ArrayList<Integer>>(); …

Member Avatar for NormR1
0
180
Member Avatar for Buffalo101

Hello, In case anyone has used the JADE multi-agent framework: Is it possible to run a Main container on a PC and a regular container on another PC over the Internet, rather than just LAN?

Member Avatar for Buffalo101
0
68
Member Avatar for Dean_Grobler

Ello, Does anyone know of some 3rd party libraries that can simplify working with XML through Java, because as we all know the normal SDK's libraries are terrible.. Thanks in advance!

Member Avatar for Ezzaral
0
155
Member Avatar for IcantC

Hello, forum. My question is: how can I format my output when outputting in JTextArea. I want to have the same functionality as System.out.format has (custom spaces between values). Maybe it is possible to print PrintSream objects in JTextArea? I am currently using append(String s) method but I am not …

Member Avatar for IcantC
0
727
Member Avatar for scoobie

Hi, I was wondering if someone could help me. I am using java SWT and am trying to output a list of files and its properties to the screen. I have a file browser popping up and when i select a directory and click ok it outputs the path and …

Member Avatar for Murdok@i
0
413
Member Avatar for ankit.pandey3

[CODE]import java.io.File; import java.io.IOException; import java.io.FileOutputStream; import java.io.FileNotFoundException; import java.awt.TextArea; import java.awt.Font; import java.awt.Color; import java.awt.Image; import java.awt.Toolkit; import java.awt.Canvas; import java.awt.Graphics; import java.awt.FileDialog; import java.awt.event.*; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import javax.print.DocFlavor.URL; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JButton; import javax.swing.JTextField; import javax.swing.Timer; import javax.swing.event.MouseInputAdapter; import javax.swing.*; …

Member Avatar for ankit.pandey3
0
232
Member Avatar for Armanious

I'm trying to replace values in an array while removing extra values. This is what I have, but it doesn't seem to work and I have no idea why. I'm just challenging myself to not use any Strings in my project. This will be the last step. [CODE]/** * * …

Member Avatar for jon.kiparsky
0
1K
Member Avatar for warlord902

Let me tell you I already got the tutorial on how to do this [url]http://db.apache.org/derby/docs/10.3/adminguide/tadminconfig814963.html[/url] But sincerely speaking I did not understood how to do any of the two methods described. Let me tell you my confusions and what I didn't understood and I am developing my project in netbeans. …

Member Avatar for warlord902
0
1K

The End.