32,199 Topics

Member Avatar for
Member Avatar for niall.lennon2

[CODE]class Date { private int day, month, year; // the date Date(int d, int m, int y){ day = d; month = m; year = y; } Date(){ }; void get() { day = Console.readInt(); month = Console.readInt(); year = Console.readInt(); } void put(){ System.out.println(day + "/" + month + …

Member Avatar for Ezzaral
0
165
Member Avatar for gyno

[CODE]public class Employee{ public String fNa; public String lNa; public String Title; public int ID; void doEmpThings() } public class Director extends Employee{ void doDrictorThings() } public class UseEmployee{ public static void main(String []args) {codes} } public class UseDir{ public static void main(String []args) {codes } } [/CODE] Now what …

Member Avatar for gyno
0
107
Member Avatar for nick100555

I have the following CashRegister class where i must implement 3 methods: -getSalesTotal total up sales for the day -getSalesCount total number of sales for the day - rest a reset method that returns all instance variables to 0 Here is my code any help on mistakes i may have …

Member Avatar for Syrne
0
331
Member Avatar for vijaykavin10

Can any one explain what is the usage of creating a contentpane in swing...

Member Avatar for mKorbel
0
130
Member Avatar for andimiami

Hi! I am trying to write a method w/i a larger program, and it's purpose is to read in a section of the string between " " and then within that section split each subsection apart if it contains spaces and matches a particular RegEx and if a space is …

Member Avatar for hfx642
0
108
Member Avatar for moonknightt

Design and implement a stringed musical instrument class using the following guidelines: a. Data fields for your instrument should include number of strings, an array of string names representing string names (e.g. E,A,D,G), and boolean fields to determine if the instrument is tuned, and if the instrument is currently playing. …

Member Avatar for peter_budo
0
281
Member Avatar for SasseMan

Hello! I've written some swing components for which I use timing framework to make some simple animations that hopefully are going to enchance usability. What I am doing is essentially setting the bounds of JPanels for each timing event to animate something that moves and resizes. I also change transparency …

Member Avatar for JamesCherrill
0
128
Member Avatar for Onlineshade

Can any one say how to run a java program in Notepad. I have installed JDK 7 and Notepad++ also. But when I run a program in notepad it does not run. Actually I am a newer in notepad using. I have used Netbean IDE. But now I wish to …

Member Avatar for Onlineshade
0
182
Member Avatar for Nathan_11

i have this array code that would give the sum of the random numbers in the columns, however i could not figure out how to display the sum of the rows.. can someone help.. Thanks a lot... [code]import java.util.*; public class tabulated { public static void main(String[]args){ Random rand=new Random(); …

Member Avatar for Taywin
0
137
Member Avatar for ria_ria

[code]package rolldice; import java.awt.*; import javax.swing.*; public class Die extends JComponent { private static final int SPOT_DIAM = 9; private int _faceValue; public Die() { setPreferredSize(new Dimension(60,60)); roll(); } public int roll() { int val = (int)(6*Math.random() + 1); setValue(val); return val; } public int getValue() { return _faceValue; } …

Member Avatar for Taywin
0
175
Member Avatar for london-G

Hello everyone, I am currently learning Java. I find it very hard to use string variable. Does string variables need to be declared differently? Let me explain more: I have a program(in blueJ) which reads a name and returns it. [CODE] public class ReadName { // instance variables - replace …

Member Avatar for Taywin
0
152
Member Avatar for aanders5

Ok, so basically I made a little image of what is supposed to happen. The goal is that there is a JComboBox, and below it is a Jpanel that updates when different options are selected from the JComboBox, there are about 6-7 different forms/options that each appear when a different …

Member Avatar for mKorbel
0
108
Member Avatar for Dexxta27

This program is supposed to output some shapes using the GUI. I can't get it to actually output the shapes, but the panel shows up fine. Could someone show me what I am doing wrong? This one does the Panel and all that other stuff. [CODE]package pregui; import java.awt.Color; import …

Member Avatar for JamesCherrill
0
133
Member Avatar for pradeep_java

If EOF (End of File)flag in Java like there is in .NET. If yes in which class is it present. The problem I am facing is that i cannot edit the input file and the values are present in very alternate line. Therefore I cannot ensure whether the entire file …

Member Avatar for pradeep_java
0
578
Member Avatar for ceyezumma

Hello. Is there someone with experience using One Jar or any other technique to create an exe. file from a Netbeans project with a lib full of .jar dependencies. I am useing the One Jar technique and I am not having an success creating the manifest. Thanks Steve

Member Avatar for peter_budo
0
164
Member Avatar for BleepyE

Ive just started working with Java at Uni and im doing a little project including floating, double, and integer numbers. Ive simplified the project just so you can see what the basics are. [LIST] [*]The bottom 3 print lines show how many of a single type of coin are required …

Member Avatar for BleepyE
0
125
Member Avatar for sirlink99

If I have a himachi server running is there a way to send a file into a specific folder on a different computer without them having the client? For a file transfer like program that the recipient does not need to download?

Member Avatar for sirlink99
0
43
Member Avatar for Donieob

I have a JTextArea in a JScrollPane with hundreds of lines of text in it. I would like to add a JComboBox with some key words in it and when the user selects one of the key words the scroll pane moves to the first appearance of this word in …

Member Avatar for peter_budo
0
171
Member Avatar for bd338

I'm running Mac OS X Lion on my 64-bit MacBook, and I can't run any of the QT Jambi applications I create. Here's the code of the test program I'm trying to deploy. [CODE]import com.trolltech.qt.gui.QApplication; import com.trolltech.qt.gui.QPushButton; public class GUI { public static void main(String[] args) { QApplication.initialize(args); QPushButton b …

0
90
Member Avatar for Onlineshade

I have installed JDK 7. Is it possible to write code in JDK without Netbean IDE ?

Member Avatar for Onlineshade
0
289
Member Avatar for Onlineshade

Which software is needed with JDK 7 to write this code? [CODE] import java.net.*; class OreillyByAddress { public static void main (String args[]) { try { InetAddress address = InetAddress.getByName("204.29.207.217"); System.out.println(address); } catch (UnknownHostException e) { System.out.println("Could not find 204.29.207.217"); } } }[/CODE]

Member Avatar for Onlineshade
0
255
Member Avatar for Priyank19

Acutally, on daily basis, I have to open a website,log into that, navigate to a link/page,export an excel sheet and do some processing. I want to ahead to automate the same through Java Program.

Member Avatar for peter_budo
0
205
Member Avatar for johnscanlon

Hi, trying to make a chat system with multiple servers. Server needs to send message from a client to all the other clients. But need to save the client ports that are connected to the server in order to do this. Not really getting anywhere with this, i'll post ode …

Member Avatar for johnscanlon
0
2K
Member Avatar for alteran

I'm having a problem with adding the name, dob month, dob day, and dob year to a binary search tree from the information from the GUI. This has to happen after the "Add Person" button is clicked. I should add it inside the brackets of the "if(e.getSource() == addPersonButton)" statement, …

Member Avatar for JamesCherrill
0
191
Member Avatar for Priyank19

Hi, This is really a nice piece of code. I want to move a bit ahead. Acutally, on daily basis, I have to open an internal website,loginto that, navigate toa link/page,export an excel sheet and do processing.Can I go ahead to automate the same through Java Program. [Note : I …

Member Avatar for peter_budo
0
131
Member Avatar for ynwa

Hi, My code is organized in the following way projectFolder/source/all .java files and projectFolder/classes/all .class files The class path is set to project/classes Now when i compile my Main.java class from source folder, a Main.class is generated in classes folder. Now when i try to run the program using java …

Member Avatar for ynwa
0
227
Member Avatar for ynwa

Hi, I am a java newbie. I am getting the following error in eclipse. Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-cocoa-3557 or swt-cocoa in swt.library.path, java.library.path or the jar file I have the following jars in my library. _swt-cocoa-32 _swt-cocoa-64 swt-cocoa-32 swt-cocoa-64 swt-gtk swt-gtk-64 swt-win Can anybody help me ? …

Member Avatar for peter_budo
0
878
Member Avatar for us0343

hi All, I've just start java have a problem with compiling an Application. First i done Coding : [CODE]/* This program Will take two arguments Hello world from the command Prompt and prints them to standard console. If you specify less then two arguments an exception Will be thrown*/ public …

Member Avatar for peter_budo
0
182
Member Avatar for Nathan_11

i have code using method yet i could not make it work.. Can someone help me.. Thank you. package scsiaug10; import java.io.*; public class Main { public static void main(String args[])throws IOException{ BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter a Word:"); String s = read.readLine(); char c[] = new char[s.length()]; …

Member Avatar for Nathan_11
0
135
Member Avatar for DragoDraco

Here is the code I have so far and when I compile it I get errors import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Bible2a { public static void main ( String [] args )throws FileNotFoundException { Scanner dataFile=new Scanner(new File("test.txt")); /*int colonPosition = verse.indexOf(':');*/ while(dataFile.hasNextLine()) { String verse = …

Member Avatar for DragoDraco
0
152

The End.