32,204 Topics
| |
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 … | |
[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 … |
The End.