35,618 Topics

Member Avatar for
Member Avatar for jrlynch1

Hello! I am working through some program to auto-print files to a post script printer via the LPR command. The entire program is running, going through directories, finding the files, then deleting the files. Before deleting the files, though, I added in a section to try and print the files …

0
75
Member Avatar for bigbags911

import java.io.*; import java.util.*; public class Reverseing { public static void main(String[] args) throws Exception { File f = new File("backwards.txt"); Scanner finput = new Scanner(f); String sentence = "", s = "", r = ""; while(finput.hasNext()) { sentence = s + finput.nextLine(); } ArrayList<String> lines = new ArrayList<String>(); ArrayList<String> …

Member Avatar for bigbags911
0
2K
Member Avatar for ceyesuma

Hello I am trying to figure what kind of code that would be needed to add a JTabbedPane to an JInternalFrame. I have 7 tabs added now (as many as I need) they are added by simply adding(hard coded) the "text name" to an array and every time the program …

Member Avatar for ceyesuma
0
88
Member Avatar for Dayana Raju

Does anyone know how to put an Image in a Box Layout...just beside the buttons....Pls post me the code if anyone knows it?

0
26
Member Avatar for tones1986

Hey guys, I am trying to store a varying number of coordinate points in an array. So i thought of a list, and declaring this list as an arraylist using the Point class. Make sense so far? Or am i incorrect already? In doing so i came up with this: …

Member Avatar for tones1986
0
4K
Member Avatar for CelestialDog

Hi guys, I've hit a problem I'm hoping someone can help me with. I'm trying to create a little irc bot application, just to learn how to use sockets in Java. Everything works fine so far up to the point where I try to pass the data coming from the …

Member Avatar for CelestialDog
0
115
Member Avatar for handrews3583

I have to write a program using accessors and mutators and a constructor that stores a savings account's annual interest rate and balance. The class constructor needs to accept the amount of the savings account's starting balance. The class needs to have methods for subtracting withdrawals, adding deposits, and adding …

Member Avatar for sfeinst
0
875
Member Avatar for chouki

hello I'm trying to make a program that allows you to return and calculate the shortest common supersecuence using dynamic programming. The basic ideas of supersecuence common Shortest to search a given set of strings for example L, the smallest chain, which is one for each string supersecuence L. the …

Member Avatar for chouki
0
73
Member Avatar for Amu_anu

we r making an image viewer for our mini project....n we hav tried doing it on our own ..but we are able to show only 1 image ...how to show many images using say 10 images in database?? we want functionalities like easy preview of next / previous image from …

Member Avatar for jephthah
-2
100
Member Avatar for shar88

is there any sample of java topological sort algorithm based on minimal vertex method. I also need to implement the ADT graph using adjacency lists representations

Member Avatar for dsmush
0
109
Member Avatar for codiction

This particular snippet will display a chessboard in a new frame. Needless to say save it in a file named "chessboard.java".

Member Avatar for mundvawala
0
1K
Member Avatar for kelvinyap828

basicallt i want to make a simple quiz...and the quiz contained 20 questions...but i have no idea in looping the question...so can anyone help me? [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; class Quiz extends JFrame implements ActionListener{ private JButton submit,next; private JTextArea text; private JTextField answer; private JLabel …

Member Avatar for stultuske
0
128
Member Avatar for jogendar

hello everyone i have created a text editor using java swings, my problem is that sometimes all features are working perfectly and sometimes they are not.... i wrote the entire program in one file and the no. of lines in it are 1770,is this a problem for that kind of …

Member Avatar for jwenting
0
112
Member Avatar for bigbags911

import java.util.*; public class KeywordSearch { Scanner input = new Scanner(new File("keyvalues.txt")); Map<String, Integer> wordCountMap = getCountMap(in); for (String word: wordCountMap.keySet()) { int count = wordCountMap.get(word); while (input.hasNextLine()) { line = input.nextLine(); numLine++; Scanner word = new Scanner(line); while (word.hasNext()){ String nextWord = word.next(); numWord++; numChar = numChar + nextWord.length(); …

Member Avatar for bigbags911
0
118
Member Avatar for bigbags911

import java.util.*; public class Dice { public static void main(String[] args) { String strInput; Scanner console = new Scanner(System.in); System.out.print(" Please enter desired sum: "); do { Random r = new Random(); int count = 0; int dice1 = 0; int dice2 = 0; a = random number; b = …

Member Avatar for vchandra
0
91
Member Avatar for innocentkid

Hi everyone, I am doing a program here to ask question about alphabet, and i am only in the middle of it and i face some problem that i really cant solve, need some help here... ok the problem is, for(int j =0; j<20;j++), in output, the 1st jlabel.setText(j) is …

Member Avatar for innocentkid
0
164
Member Avatar for sajohnson05

Here is my code for word count from command line. Ive got it reading what is in the command line but its not reading the file it just reading the words from the command line. [CODE]import java.io.File; import java.io.FileNotFoundException; import java.util.*; public class WordCount { public static void main(String[] args) …

Member Avatar for Software guy
0
111
Member Avatar for kaushik259106

Hi Everyone, I am searching the most effective way of sorting a list of objects. Say i have a bean [CODE]public class MyClass { private string name; private string id; // Getters and setters } [/CODE] Now say we put some values in a List [CODE]List<MyClass> myClassList = new ArrayList<MyClass>(); …

Member Avatar for BestJewSinceJC
0
146
Member Avatar for theg721

Hi all! I'm making an MMO in Prof. Mark Overmars' GameMaker 7. I am making an applet for it, which I will embed into a webpage. When loaded, the applet will execute the .exe which will be stored in the same directory. Anywho, I want to make a loading bar …

0
55
Member Avatar for jiten_raulo

Hi all, I have a question that , can we use java program as c++ program? Means, when we compile a c++ program we get a .exe file and we can run it anywhere or send to any one. Is the same possible in Java? As I know java creates …

Member Avatar for masijade
0
219
Member Avatar for rozbaz

Hello, As a newbie i would like to ask someone to provide me with the code that [URL="http://bookshop.blackwell.co.uk/"]blackwell.co.uk[/URL] is converstion an ISBN-10 to an ISBN-13 through the search box. For example if i paste an ISBN-10 on their search box and click search the system automatically converts it in ISBN-13 …

Member Avatar for peter_budo
0
25
Member Avatar for justM

Hi guys I would like some help with creation of Java ME class I have only been capable of coming up with the peudo-code Can someone please assist? Thanks CLASS ImageGetter Method 1: CREATE a connection to a remote server to request the image Method 2: RECIEVE the image and …

Member Avatar for peter_budo
0
184
Member Avatar for yesha27

here I have code in python and now I want to transfer it in Java. import logging import urllib import re from waveapi import events from waveapi import model from waveapi import robot from waveapi import document from django.utils import simplejson from google.appengine.api import urlfetch def OnDocChanged(properties, context): #Get Contents …

Member Avatar for jcao219
0
185
Member Avatar for bsewell

Hi all, I'm writing a card game but I can't seem to set the cards in the deck. I'm getting a runtime exception error, whether I first try to set the suit or the rank. Here's my code: Card.java [CODE]public class Card { private String suit; private int rank; Card() …

Member Avatar for armsracer
0
127
Member Avatar for sambaby

I have a small desktop application created, i wan to create a login function for this. i have a database using MySQL which stores user name and password. i wan to know how to compare the user name and password entered in the text field with the data in the …

Member Avatar for cale.macdonald
0
124
Member Avatar for Hakoo

I connected jsp with mysql. i m beg. level programmer in JSP. So, plz dont comment on my code writing style, bt plz help me to improve ma programming. I can execute query bt whn i try RESULTSET to retrive, getting error. my code is below : <%@page import = …

Member Avatar for Smith5646
0
118
Member Avatar for praneshss

Hi all, I'm basic programmer of Java..I tried to use JFormattedTextField for the first time.. It's giving error in importing sentence only.. I hav written import javax.swing.JFormattedTextField; It shows error "Cannot resolve symbol class FormattedTextField" I don't know what the problem is..Everything seems right..Please help me..

Member Avatar for praneshss
0
56
Member Avatar for paradiseis

Write an addressBook class that manages a collection of Person objects,An addressBook object will allow the programmer to add,delete,or search for a Person object in the addressBook. code: import java util.*; class AdressBook{ private String person,inputstr; private int age; char gender; Person Bob; Bob=new Person(); for (int i=2;i<names.length-1;i++) names[i]=names[i+1]; for …

Member Avatar for kvass
1
96
Member Avatar for zyaday

[CODE] public class TryCatchTest { public static void MyNumber(String x) throws TryCatchException1{ try{ String y = x.substring(0,200); }catch(TryCatchException1 e){ System.out.println("BBBBB"); System.out.println(e.getMessage()); // e.printStackTrace(); }catch(java.lang.StringIndexOutOfBoundsException e){ System.out.println("AAAAAAA"); e.printStackTrace(); e.getMessage(); } } } class TryCatchException1 extends java.lang.StringIndexOutOfBoundsException{ TryCatchException1(){ super(); } TryCatchException1(String msg){ super(msg); } }[/CODE] why is my exception not caught on …

Member Avatar for BestJewSinceJC
0
112
Member Avatar for Akatosh

Ok following the suggestion from another user I have switched over to a GroupBagLayout. Following the java tutorial in hindsight this seems easier. But alas, I have ran into a problem which does not make any sense to me. See screenshot: [url]http://img189.imageshack.us/img189/1060/groupbaglayout.png[/url] I have started from a top down approach …

Member Avatar for Akatosh
0
107

The End.