32,204 Topics
| |
i cant seem to print imageicon in board.java. any ideas? i got two files. board.java and WorldBackground.java i have a WorldBackground.java where i am create background image import java.awt.Image; import javax.swing.ImageIcon; public class WorldBackground { static ImageIcon background = new ImageIcon(WorldBackground.class.getResource("Images/backg.jpg")); public static Image getBackground() { return background.getImage(); } } … | |
hi everyone is there anyway to get all cell values of a column in the jtable? for instance i have to get all the values in column1 which are all integers and sum it up to the textbox. :) thanks! | |
Hello guys i trying to manage the size of two jpanel according to the size of Main Jframe. I using netbeans drag and drop Jpanel1 is big and another one is small. wat i need to do is to change those panels size when main frame is resized> how can … | |
hi, i am trying out past year questions for a resit and am stuck with the question below. Question 1 In the following you may assume the existence of the ListIterator<e> interface and LinkedList<E> class with the following methods public interface ListIterator<E> { E next(); boolean hasNext(); } public class … | |
Hi I programmed a tower defence game through java as a simple java application. I was wondering what steps do I have to take to convert it into a fully functional java applet to be uploaded onto the internet. | |
I want to make a program that analysises which key has been pressed the most as a part of my school assignment. I want that the key input be recieved by my program and later by the program it was intended for. Is there a way to do this? Please … | |
I am trying to resize the widths of the columns in a JTable. I would need to resize them when the program is running to see the full column header names. I want to resize table of database showing in swing frame. I have tried table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS) But i dont get … | |
| |
I have a class which extends JFrame and this class is made singleton (private constructor, public static method to create instance if null). But still I get one more frame when already one is open. Can someone help? | |
Hey, Iv been looking around for a simple way (meaning less than 10 lines) to reverse the order of my bytes in a byte array. At the moment my code is: public byte[] outputarray() { byte b[] = new byte[10]; ByteBuffer buf = ByteBuffer.wrap(b); buf.putLong(output); } The problem is that … | |
TrafficMad Dear Sir, I am trying to help a friend develop a “ prize page” for an existing site. While researching this I came across a script that I think this script could be adapted for my idea without too much trouble. Below my signature is the old “Lets Make … | |
Hello everybody I would like to load an image from my documents and display it in a pannel and select a part of my image a rectangle for example and save it, I saw your response Ezzaral it's very interesting but the problem is that I can not integrate it … | |
First statement: int[] it = new int[][]{{1}}[0]; //Valid Statement Second statement: int[][]it2 = new int[]{0}[0][0]; //Invalid Statement First one no explanation given. Second one is invalid because it attempts to access a two-dimensional object from a single dimension array. My query: 1. First of all can someone please interpret those … | |
Hello, I have a question regarding implementations of uploading a file from a browser to a server. I have currently two pages, page (1) is used to select the file. Using a form-submit section, the form is passed to page(2). Page (2) now gets a javabean, passing `request` to it. … | |
Hey guys, I've done alot of work coding a script that works great in Python. I hope to move it into java then hopefully into an android app. Any advice on getting started? I have searched and searched and cannot really find a good way to do this. I had … | |
1.in my project...if user want to exit from the application... it first check yes no cancel option,if the user want to choose ,no or cancel button .. the application is not closed..but my problem is what code placed for no or cancel button...to prevent closing window... code is...[CODE] class wl … | |
I created an EJB project using Spring toolkit Suite. The JDK is version 7 and the JBOSS application server version 7. However I keep getting the following error message: 17:57:35,015 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA 17:57:35,140 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA 17:57:35,202 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final … | |
I have a jtab that contains 3 items: a jtextfield that the user will enter a integer value(1-100),and press a jbutton which takes that value and thru a series of if tests generate a text response in a jtext area. example: Input = 1 Output = My Dog has fleas. … | |
Hi, I can't figure how to detect collision between Ellipse2D and Rectangle2D. I have tried intersects and contains methods with and without getBounds and getBounds2D methods but nothing works. Here is some code, ball and bat are overlapped. package net.viped; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.Toolkit; … | |
Please can someone show me how to retrieve database tables and add them as items to my JComboBox?.i have this app that i'm creating and it has a database which contains tables with their names and i want to add them as items into my JComboBox to aid file insertion … | |
Hi, im just doing some past exam papers for an exam I've got coming up and im struggling with Java generics, i cant seem to find any good examples to help me out. I've found small snippets of code but i really need a larger piece of code shown before … | |
public class QueueImpl<E extends Comparable<E>> { private int count; private class Node { private E info; Node next; } Node front; Node rear; public E peekMaximum() { Node temp = new Node(); temp = front; Node max = new Node(); max = temp; while(temp!=null) { System.out.println(temp.info); //if(temp.info>max) if((temp).compareTo(max))>0) // getting … | |
Hey :) First off this might actually be a network problem! But im also uncertain of the java code and how networking works in java. The program is basically just to transfer a file if that matters! So this is my code for setting up the connections: Server: //connection(s) private … | |
| Hi all, I've got a code here, as the title says it is a sudoku puzzle. It can create only one puzzle which is there hard coded. Now, the problem is how to add another puzzle? Or maybe I can turn this into a random generated puzzle which is hard … |
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Gui; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; /** * * @author K */ public class Genres extends JFrame implements ActionListener { Connection conn = null; private Statement stmt, … | |
I have an assignment where I am creating a BankAccount program. I have to create an ArrayList of BankAccounts and have the program ask the user how many accounts to create and then have a loop to ask the user for the accountId, name, and initial balance for each account … | |
| Create a new project called petstore_domain create 2 packages one com.anblicks.domain second com.anblicks.domain.test move all domain model in to package one and keep all the tests in package 2 Make the Catalog Class Singleton Class Create a testCatalog Class in the second package create atleast 10 tescases for testing the … |
Hey, im looking for a way to get a double value to follow the IEEE 754 standard, iv seen a number of librarys for it on java but i had my doubts to whether it was a problem that wasnt solved already with a java standard library. The value i … | |
Hi, I need some help on my stack i could not input the infix because it will generate error when i compile,and it says that non-static method priority (char)cannot be reference from a static context....Thank you in avdvance. public InfixToPostfix(int size) { stack=new Object[size]; top=0; } public boolean isEmpty() { … | |
sir i would like to know how to encrypt an image in java (the classes and how to proceed) |
The End.