32,199 Topics
| |
[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 + … | |
[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 … | |
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 … | |
Can any one explain what is the usage of creating a contentpane in swing... | |
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 … | |
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. … | |
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 … | |
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 … | |
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(); … | |
[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; } … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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? | |
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 … | |
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 … | |
I have installed JDK 7. Is it possible to write code in JDK without Netbean IDE ? | |
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] | |
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. | |
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 … | |
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, … | |
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 … | |
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 … | |
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 ? … | |
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 … | |
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()]; … | |
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 = … |
The End.