32,199 Topics

Member Avatar for
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
160
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
677
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
157
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
907
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
309
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
Member Avatar for psy.blast

import java.util.Scanner; import java.util.*; public class Interest { public static void main(String[]args) { double interest, primary, period, amount, yearly, monthly, daily, weekly, quaterly, bianually, time; Scanner Scanner = new Scanner(System.in); System.out.println(" How much money is the person wanting to loan?"); primary = Scanner.nextInt(); System.out.println("Please enter the rate of interest."); interest …

Member Avatar for steph7
0
247
Member Avatar for 47pirates

How can i change my java program in netbeans(currently) so that i can install my program in any other computer? Which is the currently best tool plzz help

Member Avatar for 47pirates
0
197
Member Avatar for champmanking

Hello. I am new to Java and I am creating a simple applet while I to learn. My problem is that one of my methods doesn't seem to be working. The applet is a simple moving sprite; use arrows to move, ect. I am trying to create a missile using …

Member Avatar for champmanking
0
384
Member Avatar for HelloMe

Hello everyone... I have just a simple project where i have to draw a picture (Robot) and on a klick on a button, the Robot turns to the left. My problem is, the Robot turns correctly but the new Robot drawing (position showing the Robot from the left side, back …

Member Avatar for HelloMe
0
197
Member Avatar for hauda67

for (k=0; k<M; k++) for (i=0; i<N; i++){ c[i][k]=0.0; for(j=0;j<P;j++) c[i][k]+ =a[i][j]*b[j][k]; I have implemented the above sequential matrix-matrix multiplication algorithm, but i'm not sure about implementing a method to display the output to verify that the algorithm works as expected.

Member Avatar for NormR1
0
473

The End.