32,204 Topics

Member Avatar for
Member Avatar for hwoarang69

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(); } } …

Member Avatar for hwoarang69
0
226
Member Avatar for r0n

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!

Member Avatar for JamesCherrill
0
2K
Member Avatar for 47pirates

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 …

Member Avatar for JamesCherrill
0
193
Member Avatar for scarletfire

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 …

Member Avatar for JamesCherrill
0
205
Member Avatar for Yarra

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.

Member Avatar for Justinvzepeda
0
288
Member Avatar for aero31aero

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 …

Member Avatar for aero31aero
0
204
Member Avatar for heenakashyap

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 …

Member Avatar for heenakashyap
0
162
Member Avatar for bigzos
Member Avatar for rajesh1158

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?

Member Avatar for bibiki
0
678
Member Avatar for trishtren

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 …

Member Avatar for trishtren
0
3K
Member Avatar for wheels031799

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 …

Member Avatar for wheels031799
0
157
Member Avatar for mia16

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 …

Member Avatar for mia16
0
202
Member Avatar for rahul.ch

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 …

Member Avatar for rahul.ch
0
158
Member Avatar for fpsasm

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. …

0
127
Member Avatar for toyotajon93

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 …

Member Avatar for M.S.
0
146
Member Avatar for sathya88

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 …

Member Avatar for hoon85
0
3K
Member Avatar for solomon_13000

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 …

0
119
Member Avatar for mikewyatt

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. …

Member Avatar for mikewyatt
0
227
Member Avatar for Viped

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; …

Member Avatar for Taywin
0
908
Member Avatar for Andyjava

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 …

Member Avatar for Ezzaral
0
154
Member Avatar for Cragsterboy

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 …

Member Avatar for Taywin
0
200
Member Avatar for shanki himanshu

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 …

Member Avatar for JamesCherrill
0
151
Member Avatar for Krokcy

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 …

Member Avatar for Krokcy
0
286
Member Avatar for wiliams.kikert

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 …

Member Avatar for Taywin
0
312
Member Avatar for ratatat

/* * 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, …

Member Avatar for JamesCherrill
0
180
Member Avatar for lbgladson

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 …

Member Avatar for NormR1
0
2K
Member Avatar for haritha.devarakonda

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 …

Member Avatar for NormR1
0
684
Member Avatar for trishtren

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 …

Member Avatar for trishtren
0
232
Member Avatar for ezekel

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() { …

Member Avatar for ezekel
0
579
Member Avatar for ankit.sinha.31521

sir i would like to know how to encrypt an image in java (the classes and how to proceed)

Member Avatar for trishtren
0
579

The End.