32,205 Topics
| |
I have an assignment below: 1. Create a class called Furniture with the following attributes: furnitureType – a String modelNumber – a String price – double quantitySold – int totalCharge - double. Provide the following: 1. A non-default constructor for Furniture 2. Settors and gettors for price and furnitureType (don’t … | |
Hi everyone, As part of an assignment we have to develop a recursive backtracking solution in java to a sort of knapsack problem - you have a 150mm bar, a set of orders you have to cut and you need to come up with the best solution that gets the … | |
Hello, let's say I have these classes: [code=java] public class ClassA extends JFrame{ private JButton btn1; private JPanel panel; public JPanel getPanel(){ return this.panel; } ClassA(){ this.setSize(500,500); this.setVisible(true); panel=new JPanel(new FlowLayout()); btn1=new JButton("LALALA"); this.add(panel); panel.add(btn1); } } public class ClassB { ClassA a; ClassB(ClassA a){ this.a = a; JButton button2 … | |
I'm having trouble formatting a binary tree. In my program, the tree format should print every output as such: 35 30 29 25 24 20 15 This is the code that I have thus far. [CODE]public void treeFormatTraversal(){//begin int level = 0; if(root !=null) treeFormatHelper(root, level); else System.out.println("\nTree is Empty\n"); … | |
| Hi all, I recently made a web crawler as part of a Uni team project building a small search engine. I've managed to incorporate it into our GUI, there is a button which starts the crawling process by creating the crawler in a thread. (I did this because otherwise the … |
Hello, I'm making an application that supports sending text/files. It will use a server and 2+ clients. The clients won't communicate directly with each other, their messages will be forwarded by the server. My problem is this: in C++, after starting a client, I'd have 1 thread stuck on RECEIVE … | |
Hi everybody, I have a question about purchasing a product which I do not know the name of or where to buy from. I have the following requirements for a PDA but can somebody point me to a few links of where I can buy such a device. My requirements … | |
I am working if application and I cannot figure out how to make a box move forward one at a time when the spacebar is pressed. Here are my codes: [CODE] package DrawingInApplications; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.*; import javax.swing.JFrame; public class Program extends Drawing implements KeyListener{ Drawing d; … | |
Any help would be appreciated. I have a working command line program (trivia question) and decided to try to put it in a Gui. I got the user menu to print, but it gets to line 162 and blows up (going line by line) where I'm thinking it should do … | |
Hello all. The Java Date and time classes are difficult. I think I have to use java.sql.Date which is a sub class of Date but is not a date unless the time is normalized to zero. so I've heard. I would like to work with my studentDOB first by collecting … | |
Hi Guys, I really need help with my checkbook. My functions seem to be working. However when I can deposit, balance, or withdraw from the userinterface it doesn't seem to store the updates. When I check my balance it always says the balance is 0.00. Can someone help me fix … | |
Hello I have a java program that sends mail to given gmail account. Now i need to attach some files to mail and send them. how can i do it?? | |
Sorry.... i have posted this question before in JavaRanch Forum but i did not get any satisfactory answer to my question. probably no one notices there. I am posting here with the hope that someone will come forward and give me some suggestion. i am using java swing and i … | |
I have a JList that becomes populated from click on buttons. My question that i need help with is, is it possible to use a function of the JList to get the string from a selected index and make a substring? thanks. | |
I'm basically writing a bot for the game Bejeweled. Everything works, however it appears to be a bit slow.. and I'm guessing it has to do with the way I'm gathering data for the program to use. Essentially, I take a screenshot, open that file, and grab the RGB'S, add … | |
I am trying to write the code for a face that winks. My code doesn't give me any errors however when I try to run it the window comes up as a blank window. It does have the corredt title but no face is drawn in it and I'm not … | |
i have a as an array b also .. how can i find the summation of there content .. thank you .. | |
Hi, I'm trying to create an array for converting Octal number from input to Binary later...print out for table look-up. Please help! [CODE] import java.util.*; // Scanner class public class check1 { public static void main(String [] args) { int i; String biArray[]={"000", "001", "010", "011", "100", "101", "110", "111"}; … | |
Hi I want to create an html report based on a table named inventory on sql server 2005 database. first code used to generate an output report [CODE] try { // TODO add your handling code here: String s = "<html> <body> <table border=1><caption> Inventory Report </caption>"; s += "<tr><td>Item_id<td>item_name<td>Existing … | |
Hi there, Can anyone point me to where I can find good tutorials (or even an online book) of how to connect to XML with Java (Reading/Writing to an XML file etc). I've tried to Google it but I just seem to find tutorials that are very confusing and vague. … | |
Here; is my scenario; A prisoner is admitted in a prison at this date:: [B]2011-05-05[/B], he was sentenced for [B]5 years[/B] so how do i calculate date additions so the results give me [B]2016-05-05[/B], as this is the exact date he is to be released from prison. the addition should … | |
I'm trying to create a class that calculates for the next possible coordinate for a Bishop Piece for my chess program and I encountered this problem. I used a JOptionPane to test for the results and I can't understand how it got that result. The first JOptionPane shows false because … | |
[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import java.io.*; public class MuseumPanel extends JPanel { private JLabel label; private JPanel buttonPanel; private JButton week, day, hour, output; private Museum museumArray = new Museum(); private int numb; int[] weekArray = new int[3]; int[] dayArray = new int[7]; int[] hourArray = … | |
i know that it puts the bytes into a buffer. But is that buffer is located somewhere in the memory? and doesnt it make the application slow if it uses that adapter?/Stream? | |
Alright im really struggling here... I have a multiple buttons that can be pushed and within the action listener i want the item added to my list model, and the running total to be incremented by the amount i specifiy within the actionperformed statement. for whatever reason i am having … | |
TableColumn column1=table.getColumnModel().getColumn(2); column1.setPreferredWidth(400); I tried to change the column width of the jtable using the above method but i couldnt achieve i dont no why please help me................. | |
I have created one Jframe mainframe which size is fit to monitor size. I have created another frame called subframe which size is 300,300 . My problem is when i open the subframe from the mainframe iam not suppose to use mainframe without close the current frame . How can … | |
First of all, i have a program where when i click a button an item is added to a list and at the same time i'm trying to get a double to display elsewhere. I am just in a funk right now and cannot think properly. what is good. when … | |
my code plays a midi java sound file , but i want to play it in a loop constantly ! can somebody help me please ! [code]import javax.sound.midi.*; import java.io.IOException; import java.io.InputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; public class MidiPlayer{ public static void main(String[] args) { try { Sequencer sequencer = … | |
I am trying to output every single possible combination of a string. So if the string was "abc" it should output a b c ab ab ba bc ca cb acb bac bca cab cba Is there any method that would help me do this? :) |
The End.