36,051 Topics

Member Avatar for
Member Avatar for utkarshsahu

My aim is to fill a 3x3 grid of Jtextfield in java swing with values and position of entry in that grid sourced from a text file.I made a file named aa.txt. Its contents are:- a1-3 b3-9 c2-4 a1,b3,c2,... are names of textfields in grid and numbers separated by hyphen …

Member Avatar for JamesCherrill
0
377
Member Avatar for utkarshsahu

I am attempting to make a TicTacToe in java using Swing. Instead of using buttons for mark(x and o) placing on 3x3 grid, i used textfield(variable name- pos) to specify position of mark entering and another textfield(var name- val) to take value to insert it into the position which i …

Member Avatar for tux4life
0
207
Member Avatar for nickerst

So I have been working on this project for quite some time and I can't figure out why I keep getting an "Illegal Start of Expression" error. I tried moving the variables above the main method and that only returned the same error but instead of the error occuring at …

Member Avatar for nickerst
0
324
Member Avatar for IcyFire

I have this paint program and i'm having a very silly problem. I'm trying to set the paint area to west position using border layout but when i do that it doesn't show up when i run the program. if i set it in the center it shows up. everything …

Member Avatar for IcyFire
0
698
Member Avatar for Aditya_4

class Emp { int name, emp_no, addrs, ph_no, deprtmnt, post, project; Emp(int a, int b, int c, int d, int e, int f, int g) { name=a; emp_no=b; addrs=c; ph_no=d; deprtmnt=e; post=f; project=g; } Emp(int a, int b, int c, int d) { name=a; emp_no=b; addrs=c; ph_no=d; } Emp(int a, …

Member Avatar for Aditya_4
0
205
Member Avatar for mukororokudo

Hello Everybody, i'm having a problem with my code. I'm making a word reverser program though I'm not that much knowledgeable about java. The output that I'm aiming for is something like this "olleH dlroW" by inputting "Hello World" string. I'm getting the output that I'm looking for when I'm …

Member Avatar for JamesCherrill
0
230
Member Avatar for Viped

Hi. I have a problem with launching my application as applet. The game runs fine as an application. my applet code: package net.viped.breakout; import java.applet.Applet; import java.awt.GridLayout; public class GameApplet extends Applet { Core core = new Core(); public void init() { setLayout(new GridLayout()); add(this.core); } public void start() { …

Member Avatar for jalpesh_007
0
250
Member Avatar for eikal

hello, i have made the code below. however, when comparing the two strings they are not equal when in theory i thought they would be. String word="abc"; String d=""; d += "a"; d += "b"; d+= "c"; if(word==d) { System.out.println("IS EQUAL"); } When i just print out string d it …

Member Avatar for eikal
0
252
Member Avatar for sparkthesunoff

I need to write a program that can draw stuff on a frame, let's say, trees. Their IDs, colors, positions etc. are in a **txt file**, line by line, the first word of the line is the name of their type which will be the name of the subclass. These …

Member Avatar for tux4life
0
804
Member Avatar for dharmil007

Hi guys i m doing an EJB project on Library Management using NetBeans Out of which the first Step create a "CREATE ACCOUNT" page & get all the details from User & store it in Database. Using JSP for this. Everything is created, but when i try to Click Submit …

Member Avatar for subramanya.vl
0
3K
Member Avatar for vishalonne

Hello I have 5 jtextfield in my jframe with 5 jbitton. I just want to move the cursor from jtextfield1 to jtextfiled2 and then to jtextfield3 and so on when I press tab key. This can be done in C# very easily by setting the tab sequence while designing the …

Member Avatar for Rajshri Patil
0
114
Member Avatar for trishtren

hello, Iv been trying to write a java program to read an image from a list of images in a file I.E: * File * Filename * Image1 * Filename * Image2 * Filename * Image3 The problem i am having is that the filename's are string objects followed by …

Member Avatar for vishalonne
0
149
Member Avatar for bsunkel

Hey there! I have been trying to get all my JTable cells to be not Editable so you can't change the info displayed on the JTable. It sounds easy to do but I cant seem to do it. Any help would be appreciated Thanks!!

Member Avatar for sdasdasd
0
8K
Member Avatar for vikarna

Hi, i want to read the data from text file and write to excel file. if some one has ready code written then please share with me.

Member Avatar for peter_budo
0
2K
Member Avatar for alaky

I have a problem with tika parser that can't read temprory zip file that it had created . this StackTrace is : java.lang.InternalError: jzentry == 0, jzfile = 139750727169136, total = 235, name = /tmp/apache-tika-8076182698055047262.tmp, i = 176, message = null at java.util.zip.ZipFile$2.nextElement(ZipFile.java:322) at java.util.zip.ZipFile$2.nextElement(ZipFile.java:304) at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:158) at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:615) at …

Member Avatar for stultuske
0
211
Member Avatar for Petranilla

Hi Everyone, Happy 2013 to all.I'm using JOption to print a table, how do I align the columns? I am using a single variable for the JOption. Example: QTY ITEMS UNIT PIRCE AMOUNT 1 Milk-Anchor 100.00 100.00 10 Del Monte-Tomato Sauce 1000.00 1000.00 Any suggestion will be great. All the …

Member Avatar for Petranilla
0
120
Member Avatar for Java is King

So, I'm trying to make a game of tic tac toe using JFrame and JPanel. This creates the board image 3x3 . package book; import javax.swing.JPanel; import java.awt.BasicStroke; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JButton; public class Beginning extends JPanel { public void drawBoard(Graphics d){ int r …

Member Avatar for tux4life
0
198
Member Avatar for Nandhinidevi

Hi All, I need to trunk a float number with one decimal place. For eg: i have a float number called total=95.20004. my result should be 95.2. I have tried with the DecimalForma, but it is not working out. Kindly help me to resolve this issue.

Member Avatar for tux4life
0
216
Member Avatar for freakyboard

I need to encode the sending messages/data(not MD5)and then they will be decoded on the other side. Codes have to be in android libraries not in java. Is there any code or information that may help me around internet? Thx all for your help.

Member Avatar for peter_budo
0
327
Member Avatar for love1969

Design and implement the class Day that implements the day of the week in a program The class day should store the day, such as Sun for Sunday. The program should be able to perform the following operations on an object of type Day: A. Set the day B. Print …

Member Avatar for jwenting
0
104
Member Avatar for trishtren

Hello, Im looking for a way to construct a scale-able 2d list or something of the sort. What i have so far is an array int [][] mydata = new int[6][4]; The problem is in my editor i wont know how long to make the array as people are going …

Member Avatar for jwenting
0
129
Member Avatar for sirlink99

I am attempting to write a very simple chat program to test out ServerSockets and Sockets, the code should work, but when the client make a connection to the server it does not move past the accept method. I know they connected because as soon as I close the client …

Member Avatar for JamesCherrill
0
474
Member Avatar for daudiam

Both DataOutputStream and PrintStream do basically the same thing - convert primitive types and Strings to bytes before writing them (writeUTF() is an exception). Why different classes ?

Member Avatar for JamesCherrill
0
1K
Member Avatar for mumaga

Hi, I want to creat a record of user journey thought the game I'm coding, that would record a script of the user inputs to a separate log file, I am thinking of creating a userrecord class and the user input will be stored into a text file using filewriter …

Member Avatar for mumaga
0
152
Member Avatar for myadav

Hi Everyone I want to make my code run from command prompt I am using window 7 and JDK 6 Following are steps I did: 1) Created a Text file Example.txt. Changed the file extension to Example.java and placed it under C:\myWork 2) Open command prompt type 'dir' to see …

Member Avatar for NP-complete
0
341
Member Avatar for Neversleepin

Hello, how can copy and save the console message to a file using logger. i try this :[Click Here](https://friendpaste.com/6FWNg0QIzY7DoPXisOyqpv) but it's only saving warning and info messages to my file. thank you

Member Avatar for subramanya.vl
0
148
Member Avatar for Kewne

I'm confuse ..... What do I really need to install in order to use the API for bluetooth? I'm going to develope a wireless mobile application that can communicate with my laptop....

Member Avatar for Kewne
0
208
Member Avatar for mumaga

Hi! I have a super class called character, subclass player. when i compile, i get this error: constructor Room in class Room cannot be applied to given types; from this bit of code in Character: public Character(Room room, String name) this.name=name; currentRoom = room; Room currentRoom = new Room(); // …

Member Avatar for mumaga
0
269
Member Avatar for mumaga

Hi, I am working on the World of Zuul. I am adding the take item command, when I envoke it, the output prints twice! The main class is Game, this is the take method. public void takeItem(Command command) ( if (!command.hasSecondWord())( // if there is no second word, we dont …

Member Avatar for mumaga
0
121
Member Avatar for asif49

Hi, I'm really interested in things like image recognition and certain other aspects that Artificial Neural Networks perform really well at and I'm hoping to do a personal project with ANNs in the future. The problem however is that my knowledge of them isn't that elaborate at the moment. All …

Member Avatar for asif49
0
202
Member Avatar for maduxi

am working on a project to write a program that finds 10 most used words in a text, but i got stuck dont know what i should do next can someone help me please. i come this far only import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import …

Member Avatar for maduxi
0
345
Member Avatar for kjetyey4

public class InputData { String[] descr = {"Apples", "Bananas", "Berries", "Grapes", "Lemons", "Lime", "Melons", "Nectarines", "Oranges", "Peaches", "Pears", "Plums", "Strawberries", "Watermelon", "Asparagus", "Broccoli", "Cabbage", "Carrots", "Cauliflower", "Celery", "Corn", "Garlic", "Lettuce", "Mushrooms", "Onions", "Peppers", "Potato", "Squash", "Sweet Potato", "Tomatoes", "Zucchini", "Cherries", "Mixed Fruit", "Peaches", "Pears", "Pineapples", "Asparagus", "Carrots", "Corn", "Greenbeans", "Peas", …

Member Avatar for john.w.austin.39
0
212
Member Avatar for lena1990

hi i want to upload an xml file from my computer to a server but i donot know is there is a website that do that i want to do it for test purposes but my server is not ready yet and i need to make sure that the program …

Member Avatar for subramanya.vl
0
251
Member Avatar for fallen21468

Ok so I am trying to build a little program and I want to be able to click on the skate or dice button and have the program open a new JFrame that has been built in another class. Currently it opens its own JFrame that was built in this …

Member Avatar for fallen21468
0
1K
Member Avatar for mattsearle

# Math.round # Hi, could someone please add the math.code function in the code below so that the resulting answer in the div is to two decimal places. <script type = <"text/javascript"> function calculate() { A = document.getElementById('input').value; outDiv = document.getElementById('output'); B =(parseInt(A) * 1.0); //alert(A); D = (parseInt(B) * …

Member Avatar for Taywin
0
193
Member Avatar for Neversleepin

Hello everyone, i have a NullPointerException error in my code at line4. Can someone guide me please. the code is here:[Click Here](https://friendpaste.com/21WFtusmIesUcgQ8erTzT9) Thank you very much NS

Member Avatar for stultuske
0
108
Member Avatar for NidhishKrishnan

i've done an application with two JTextField with the autocomplete feature the application works fine but On clicking the Tab Button while the mouse pointer is on the first TextField the Mouse focus is not going into the second Textfield but gets the focus on the second time. i.e for …

Member Avatar for radhakrishna.p
0
824
Member Avatar for ibthevivin

For each part (A) (D) below, clearly indicate whether the runtime is O(log n) or O(n). Can someone please explain how this works? public class Q9f { public static void main(String[] args) { int n = ...; int[] a = new int[n]; // (A) for (int index = 0; index …

Member Avatar for tux4life
0
208
Member Avatar for jalpesh_007

i have one question. I understand the type conversion in java.But i dont know where to use which conversion. Below i have given one example,but i don't which is used where? String s=”27”; int i=Integer.parseInt(s); System.out.println(i); /////////////////////////////////// String s=”27”; int i=(int)s; System.out.println(i); Although both are doing the same thing,but where …

Member Avatar for JamesCherrill
0
113
Member Avatar for sofien.fkih

I created a program that is running daily at a certain time, but I want this program to stop at some particular days(week ends), I have used the below codes to set the current time, public int GetDateNow() { Calendar currentdate = Calendar.getInstance(); DateFormat dateformat = new SimpleDateFormat("HHmm"); String datenow …

Member Avatar for tux4life
0
100
Member Avatar for Noopit

I Basically wanted to take an input and store it into a 2D Array called mat with a 3x3 size so i tried taking an input string, convert them into char and then sotring them in an array list and this is what i wrote so far. System.out.println("Enter Message"); Scanner …

Member Avatar for tux4life
0
3K
Member Avatar for dksinghcomnez
Member Avatar for peter_budo
0
189
Member Avatar for zlloyd1

Hi all, I am trying to learn java here, and having some difficulties with a very simple program that I am working on in an attempt to get a feel for what the language can do. This is my code so far: import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; …

Member Avatar for JamesCherrill
0
929
Member Avatar for durrat

hey i am new to gwt and i am doing an project on java and gwt and stuck in one part i want to create a reminder that is like user enters date and time and at that time a pop up should be displayed reminding user of his event.can …

Member Avatar for durrat
0
143
Member Avatar for kedxu

An **applet** I am creating **uses Timers for its animation**. Even though the Timer is set to repeat at a constant 30ms, **the applet's framerate on my computer** versus on my brother's laptop **is significantly better**. Is there a chance that **on slower computers**, the **Timer "ticks" slower**, so to …

Member Avatar for JamesCherrill
0
902
Member Avatar for xxmp

I want to sent e-mail when the user is logged to inform him that was logged and all these. Which is the best library to use for this? The server is on localhost for now Thank you very much

Member Avatar for radhakrishna.p
0
79
Member Avatar for patrick.ooi.96
Member Avatar for Rajshri Patil
0
229
Member Avatar for Darshan5

Im creating a project in java using netbeans. I have to create lots of forms for every operation. So i created a menubar and add menu items in it. Instead of creating so many jframe forms i decided to create JPanel forms for evry operation. So in this way i …

Member Avatar for stultuske
0
129
Member Avatar for sandeepyadav

Can i get java source code for making an er diagram of any database(which have entities, attributes and relationships)?

Member Avatar for Patil Raj
0
89
Member Avatar for mateusz.baran1

Hello fellows! I have question. Iam doing some project to my school and I have small problem. I have chart (iam using jfreechart) in Chart.java file and after user is loading to his profe he should be able to push button and chart wit his statistics should appear. My problem …

Member Avatar for mateusz.baran1
0
519

The End.