32,204 Topics
| |
I have created a frame , which cannot be maximized , but i want to make the frame non drag gable, want the frame in fixed position. | |
Hi everybody, Good morning...need to ask some question.. Below is my code for the cinema booking system. [code] import java.util.ArrayList; import java.util.Hashtable; import java.util.Scanner; public class CinemaBooking { final int rows = 7, cols = 4; char[][] seats = new char[rows][cols]; ArrayList<String> reservedSeats = new ArrayList<String>(); public static void main(String[] … | |
Greetings all. I'm preparing for my java data structure/algorithms class and I'm starting a personal code repository of sorts and such. I started out with c++ and my question is this: I'm implementing a controller class and a class full of sorting and search methods in java. Instead of copying … | |
I have this line of code (repeated with a bit of change) [CODE] if (ropeChosen == 1){ g.drawImage(rope, 321, 0, 10, 505, this); g.drawImage(rope, 521, 0, 10, 704, this); g.drawImage(rope, 721, 0, 10, 703, this); g.drawImage(rope, 921, 0, 10, 702, this); if (p.idol2){ g.drawImage (idol, 275,485,100,100,this); }else{ g.drawImage (snake, 300,505,50,100,this); … | |
[code=java] final String cardListStrings[] = {"First Card", "Next Card", "Previous Card", "Last Card"}; cardList = new JList(cardListStrings); cardList.setVisibleRowCount(4); cardList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); cardList.addListSelectionListener( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { System.out.println("Inside List Event Handler"); if (cardList.getSelectedIndex()== 0) { cardManager.first(deck); System.out.println("First Card"); } if (cardList.getSelectedIndex()== 1) { cardManager.next(deck); System.out.println("Next Card"); } if (cardList.getSelectedIndex() … | |
I need a user to input int and get the name of the month in return. I have this: [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package se211.dz14; import java.text.DateFormatSymbols; import java.util.Scanner; /** * * @author Boris */ … | |
Hello I'm tring to declare a BinaryOut type of object in a Java web project but it doesn't seem to work. I've imported the same libraries I used in a standard Java project so I don't know what's wrong. Any tips???? | |
I have a static class, with all methods and fields static. My methods in that class are going to use a static field declared in that class. I want that static variable(which can not be made final) to be initialized with a value taken from a database when that static … | |
Is there a simple way to get a list/array of all the predefined colors? (without listing them all individually) ? It seems as though the colors are properties of the class "Color" rather than an enumeration. | |
I have a kind of doubt, suppose I have a class like this: [CODE] public class AA{ public static createUser(String a, int b){ User usr=new User(a,b); BB.storeUser(usr); } } [/CODE] Now, if multiple threads call this createUser() method of this class at the same time, will it cause any kind … | |
HI im a student and our professor asked us to convert a number into word: example: input= "1" output="one" i need to have numbers from 1-10,001 so my program will end up very long if i only use if else statement i know that there are other methods other than … | |
Hi folk. Can I use join() method in implementation of run(), like this: [CODE] public class MyThread extends Thread { @Override public void run() { int timeout = 30000; // here is some heavy work join(timeout); } } [/CODE] Is above thread terminated after timeout milliseconds if task takes longer … | |
I'm making a calculator program but I'm stuck somewhere. I'm still new to J2ME. So guys, please take it easy on me. :). I've been trying to find the error for 4 hours now. I think the problem is, x won't retain the value.. anyway, here's the full code. [code="java"] … | |
Hi all when I run commend : "C:\LJava\project\KTest2>java -cp .;org.freixas.jcalendar;.\build components.KTest2" my code runs well I then made a jar file with the command "C:\LJava\project\KTest2>jar -cf KTest2.jar .\build\components\*.class" my MANIFEST.MF 's content is : Manifest-Version: 1.0 Created-By: 1.7.0 (Oracle Corporation) Main-Class: components.KTest2 but when I run command "C:\LJava\project\KTest2>java -jar KTest2.jar" … | |
I want to create a JFrame and add panel to it ,the problem in drawing line in this panel [ICODE] package panel; import java.awt.Graphics; import javax.swing.JFrame; import javax.swing.JPanel; public class Main { public static void main(String[] args) { JFrame window = new JFrame(); window.setSize(200, 200); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Graphics g =null ; … | |
Hi everyone. I am currently working on a small project, where I have to interface an ERP (OpenERP) with another system (SugarCRM). For that, I am going to make use of the middle-ware Mule ESB, and to retrieve the ERP data, I will make use of a Java EE 6 … | |
Hey guys, I'm making a little pokemon game in java and i've come across a problem. The basic algorithm i use for movement is as follows: - if the player has pressed a particular key set the speed(float) accordingly (if key stroke was up, X speed should drop (since i'm … | |
can any one help me wright the code for any simple java games, choose one from the selection below plsss (using jav -Base Conversions -Lotto 649 -Mastermind -Hangman -Deal or no -Deal -Who Wants to be a Millionaire -Card Games -Theatre Seating -Morse Code Instant/Fortune Teller -Pay Stubs -Educational Game … | |
Hello, I'm hoping you guys can help. I have a double linked list, and i am trying to add a bubble sort to it,I am really new to java, I've been able to do a bubble sort with great easy whilst using binary trees, but now i'm using a double … | |
Alright, so basically I have this program going, it reads the text file perfectly, I also have some arrays created. Now I need it to store each team's rebounds, assists, and points separately. From there I need to get the mean, median, mode for each section (which will be completed … | |
Hi, this is my first post here, and I really need some help with my homework. I'm a newbie to Java programming, and I have this assignment: [I]Write an application which reads data from a file about certain items (one row - one item, stored are the integer valued code, … | |
Is there any way to extend gaps between jmenuitem? | |
Hi everybody I'm trying to write such a code: [CODE] import pps.PPSFrame; public class X extends PPSFrame{ ..... } [/CODE] Of course there's no such pps package in java. Where can i find it ? or at least PPSFrame.class ? Regards, | |
I am fairly new to java and I have a program that I really need to get working. I need to pass 'alarmId' from class A to class B. I am not too sure how to go about this, any help would be greatly appreciated. [CODE] public void onStart() { … | |
Hi all there, I was reading a book on Java and came across this piece of code. Now, I am not sure how line 13 works especially, these symbols after the equal signs "passed=%d; failed=%d%n" . How do the symbols affect the output of the variables(passed & failed)? so let's … | |
I'm trying to make a cllient-server chat that only needs to be able to handle 1 connection. First, I have a data-type question: 1. At the moment I am using this code to get messages [CODE] BufferedReader ins = new BufferedReader(new InputStreamReader(sock.getInputStream()));[/CODE] And this code to send messages [CODE] PrintStream … | |
So here it is, this is my new problem, we were assigned to create a simple ATM Machine: Automatic Teller Machine [B] Balance Machine [D] Deposit [W] Withdrawal [Q] Quit Select you option: (input letter here) when i choose balance this window should pop out: Your Balance is 0.00 OK … | |
How print this series in while loop square root 1 2 4 8 16 32 64 128.......... and cube root 2 8 24 72........ | |
I'm trying to take a text file with 20x15 numbers(or characters, doesn't matter) into a 2d array. I just can't seem to get it to work. Can you help me fix it? Thanks [CODE]FileInputStream fis = new FileInputStream("MapFile.txt"); while (fis.available() > 0) { for (int x = 0; x < … | |
Hello all, I am trying to make a program that essentially takes a string of parenthesis and outputs whether or not its balanced. Basically, every '(' will push the index of that location of the string on to the stack, while a ')' will pop it off if it's not … |
The End.