43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for soham.m17

I want to add a Lable in a JComponent when a button will be clicked. I have added a actionlistner on that button. I've added this.add(label) in the JComponent. but the location, which is set by label.setLocation(...) is not maintained in the JComponent. If i use FlowLayout() in the JComponent …

Software Development java
Member Avatar for JamesCherrill
0
122
Member Avatar for fishman6

Hey, I've been trying to get this to work for most of the day. Basically I have an array of strings and I'm adding to them using strcat in a loop. It works fine for the first few loops but then the strings start to go all out of whack. …

Software Development c
Member Avatar for Narue
0
166
Member Avatar for zack_falcon

I've created a class called Piece, which I used to create a 2D array in my main program. This is the class: [CODE]namespace GG { class Piece { public int rank; public int player; } }[/CODE] And is instantiated in my main program like so: [CODE] namespace GG { public …

Software Development
Member Avatar for Mitja Bonca
0
135
Member Avatar for gahhon

[CODE]import java.util.Scanner; public class Bakery { private static String flavors; private static String weight; private static int quantity; public Bakery(){ this("Chocolate Moist", "1(KG)", 1); } public Bakery(String flavors, String weight, int quantity) { this.flavors = flavors; this.weight = weight; this.quantity = quantity; } public void setFlavors(String flavors){ this.flavors = flavors; …

Software Development java
Member Avatar for gahhon
0
123
Member Avatar for gahhon

[CODE]import java.util.Scanner; public class Course { private String courseTitle; private double feesPerStudent; private int noOfStudents; private String[] studentName = new String[100]; private int courseCount; public Course(String courseTitle, double feesPerStudent) { this.courseTitle = courseTitle; this.feesPerStudent = feesPerStudent; } public void setCourseTitle(String courseTitle){ this.courseTitle = courseTitle; } public String getCourseTitle(){ return courseTitle; …

Software Development java
Member Avatar for gahhon
0
202
Member Avatar for x69chen

MY bad this should below to C#... ignore this one please, sorry about that... --------------------------------------------------------------------------------------------- Hi people I found I can only reset the values in the array but I can resize it in a new method and return it back to main method, [CODE] static void Main() { int[] …

Software Development c++
Member Avatar for stereomatching
0
163
Member Avatar for djmonster

Hello All, Can everyone help me to solve this problem ? Im doing an assignment about downloading a file and write it to a new file. My problem is the file that I was trying to download is very large, so everytime I compile my Download class and the main …

Software Development java regex
Member Avatar for Anyday
0
198
Member Avatar for random12

Hi, im new here and also new to C++ (pretty much new to programming anyways) I have been working in an assignment and got stuck trying to store information into a 3x3 array, and then retrieving the data. [CODE] #include <iostream> #include <iomanip> using namespace std; int main() { float …

Software Development c++
Member Avatar for random12
0
134
Member Avatar for Syrne

Hi again guys. I currently have a class named [B]ElementSet[/B] which houses an array of objects as well as an array of boolean values which pertain to two function tasked with flagging or unflagging an individual object. I also have an abstract class, [B]Element[/B], and two inheriting classes named [B]Subscriber[/B] …

Software Development java
Member Avatar for Syrne
0
229
Member Avatar for v_janssens

Hi, In brief, I have written a program in C++ that reads data from a text file, does 'stuff' with that data and then writes the results to a number of separate file. Separately I've written a simple GUI for this program using Visual Basic (allows the user to select …

Software Development c++ gui visual-basic visual-studio
Member Avatar for mazzica1
1
1K
Member Avatar for gahhon

[CODE]public class Fan { final int SLOW = 1; final int MEDIUM = 2; final int FAST = 3; private int speed; private boolean on; private double radius; private String color; public Fan(){ speed = SLOW; on = false; radius = 5; color = "Blue"; } public Fan(int speed, boolean …

Software Development java
Member Avatar for gahhon
0
229
Member Avatar for Mona..

Hi .. I have this program, its reding correctly but its not doing what i want i.e. it suppose to read the input file and call the functions according to the action saved in the file this is the problem : [CODE] #include <iostream> #include <Fstream> using namespace std; void …

Software Development c++ file-system ios
Member Avatar for Mona..
0
360
Member Avatar for Forte1292

In high school I learned Pascal and C++. Everything from hello world to search trees, to graphical battleship with AI. Now I'm a freshman in college and in my CS1 class we are using Java, but after 2 months we are just now on arrays. Basically I was just hoping …

Software Development ide java pascal
Member Avatar for hiddepolen
0
93
Member Avatar for danthevan

Hello, I have a weird problem while running my project. I use netbeans and here's my code and the problem is explained after the code. [CODE]/* * NetworkingView.java */ package networking; import org.jdesktop.application.Action; import org.jdesktop.application.ResourceMap; import org.jdesktop.application.SingleFrameApplication; import org.jdesktop.application.FrameView; import org.jdesktop.application.TaskMonitor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; import javax.swing.Icon; import …

Software Development gui java java-netbeans java-swing
Member Avatar for danthevan
0
238
Member Avatar for KenGreen

In an earlier post, Tech-B stated that, other then dialogs, there wasn't 'any "real" GUI support' in Python that uses the Android SDK or SL4A/SAE. Has anyone tried Jython with the Android SDK?

Software Development gui python
Member Avatar for Tech B
0
375
Member Avatar for 2aliraza

hi plz help me how to simple displaying 1 to 20 prime numbers with for loop plz help me

Software Development c#
Member Avatar for 2aliraza
0
749
Member Avatar for ilovejava

hi i started coding battle ship when i was done i noticed that the user and computer always misses, even if they hit, i dont know what i did wrong [CODE]import java.util.Scanner; public class Battleship { public final static String USER = "user"; public final static String COMPUTER ="computer"; public …

Software Development gui hard-drive java
Member Avatar for ilovejava
0
2K
Member Avatar for Mirfath

I have two forms Login and Main Menu. I want to retrieve the username from the textbox1 from login and put it in the status strip in the main menu. However, when i change the modifier of textbox1 with this code [CODE]TextBox textBox1; public Login(TextBox txtBox);[/CODE] or any other code …

Software Development
Member Avatar for Mirfath
0
147
Member Avatar for wfws

I'm a C++ student, and I'm almost there on this assignment, except I can't get the search function to work correctly. The search function should accept a search input from the user, then list all the items related to that input. In this case, its all the tasks related to …

Software Development c++
Member Avatar for NicAx64
0
143
Member Avatar for sofia85

Hi, I don't understand how to write unix shell commands in python. I have this txt file were I want to delete duplicates. It looks something like this: RTGR.txt FRTO.txt RTGR.txt SDOP.txt QWJL.txt SDOP.txt FRTO.txt FRTO.txt ...etcetc... I think I'm suppose to import os and then I want to use …

Software Development python unix
Member Avatar for sofia85
0
144
Member Avatar for Dmennite

[CODE]private void rbWeek_CheckedChanged(object sender, EventArgs e) { if (rbWeek.Enabled == true) { DialogResult dChangeCycle = MessageBox.Show("Yes to start new billing cycle from today's date. No will make no changes to next billing Date.", "Next Billing Date Change", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dChangeCycle == DialogResult.No) { } else if (dChangeCycle == DialogResult.Yes) …

Software Development first-post
Member Avatar for Dmennite
0
153
Member Avatar for corby

i have this code for adding a node after the previous node, but valgrind is saying that there is a memory leak of 16 bytes, can someone please help me identify where the leak is? i think i didnt assign a null pointer somewhere but im not sure exactly where …

Software Development c linked-list
0
119
Member Avatar for iamthesgt

In writing a logging program for a SDK Engine, I have come across some problems. The logging function works fine when called with test programs, but when I run it in a full test of the SDK Engine, no file is ever created. I added some testing lines to make …

Software Development c++ file-system ubuntu
Member Avatar for iamthesgt
0
401
Member Avatar for karmstrong

Please take a look at the following code. When I do not put my pointers in an array the code works. See the commented out section. I thought it would be nice to do an array as I could then have more control over my output. I could also add …

Software Development c++
Member Avatar for MonsieurPointer
0
138
Member Avatar for caswimmer2011

Hey, Is there a way to get the keycode from a char? I tried using KeyEvent.getKeyCode() but the KeyEvent class didn't have a constructor so it was freaking out. I've been searching for 2+ hours already and nothing. My goal is to have a char, convert it to keycode, and …

Software Development java
Member Avatar for caswimmer2011
1
1K
Member Avatar for bettybarnes

hi i'm a vb.net programmer trying to learn C# for now. Let me ask you about simple questions in C# How do you do this in C#? this is a vb.net code: [CODE] TextBox1.Text = 1 [/CODE]

Software Development c#
Member Avatar for Mitja Bonca
0
187
Member Avatar for Ravic85

I'm having a bit of trouble figuring out what i'm doing wrong with my overloaded operators Header file [CODE]#ifndef SavingsAccount_H #define SavingsAccount_H #include <string> using namespace std; class SavingsAccount { friend istream &operator >>(istream& input, SavingsAccount & ); friend ostream &operator <<(ostream& output, const SavingsAccount & ); public: SavingsAccount(); SavingsAccount(string, …

Software Development c++
Member Avatar for Ravic85
0
1K
Member Avatar for soham.m17

I'm using ArrayList. But the problem is that the indexOf function is not working in a for loop. It's showing 0 for all the elements or objects. Code goes like that for a FOR loop : [CODE]for(or_data or : counts.or_gates) { if (or.isHit(x, y)) { mutual=counts.or_gates.indexOf(or); set_move_cursor(); or.addX(dx); or.addY(dy); System.out.println("Got …

Software Development java
Member Avatar for soham.m17
0
222
Member Avatar for Mopikope

I am having a problem with trying to copy a "char array to an int array". I have a code to randomly picked an amount of character and (in progress) print out how many occurrences, even if it's not in there a letter has. For now I'm only doing upper …

Software Development c++
Member Avatar for Mopikope
0
120
Member Avatar for Zssffssz

Well I noticed recently that the more unusual bool operators arnt there. How would I use them? Ex: xand, NAND, nor, etc.

Software Development c++
Member Avatar for mike_2000_17
0
102
Member Avatar for cvanithakpm

plz help me to know..whether this pointer in c++ is public access or private access

Software Development c++
Member Avatar for gerard4143
0
119
Member Avatar for cisumma

Hello I was working through a Netbeans tutorial : [URL="http://java.sun.com/developer/technicalArticles/java_warehouse/single_jar/"]http://java.sun.com/developer/technicalArticles/java_warehouse/single_jar/[/URL] I am having a problem understanding adding my properties and xml dependencies contained in an xml dir in my project (Please find screen print of dir) I jar my app and it can not find these files or dir. java …

Software Development app-store ide java java-netbeans java-swing
0
126
Member Avatar for prit005

Now I want to add the number of picture boxes to windows form dynamically. for eg. when user put the input in text box such as user enter 4 then Four picture boxes are added to the form at run time. also I don't know how handle the context menu …

Software Development
Member Avatar for Mitja Bonca
0
136
Member Avatar for swathys

Hi, How do i write to xml format for the below data. This is sample parsing data that i need to save in xml format. Please guide me ! [CODE]<field id="0" value="0210"/> <field id="2" value="00"/> <field id="3" value="320000"/> <field id="4" value="000000068519"/> <field id="5" value="000000000000"/> <field id="7" value="5465464545"/> <field id="11" value="000021"/> …

Software Development vb.net xml
Member Avatar for swathys
0
203
Member Avatar for soham.m17

I am building a Circuit Editor using Java. I'm now at very first stage. Now I'm building a simple editor like Paint. I've implemented a drawing-pad where you can draw straight line and continue the line until you click an right click, by a "WIRE" Button click in the frame. …

Software Development java java-swing
Member Avatar for soham.m17
0
4K
Member Avatar for Ehtesham Siddiq

Hi, I have a simple query but im just not able to get it right. Have a look at my sample code below [CODE] Sub Function1 My Code Here Function2(Year,Month) End Sub Sub Function2(Year,Month) Dim Str as String() for 1 to 30 Dim MyDate As New Date(Year, Month, i) Str …

Software Development vb.net
Member Avatar for Mitja Bonca
0
541
Member Avatar for hugo17

Hello, I'm working on a litle program. While working I stumbeled upon some problems. I would like to check if two Arrays are equal to each other. I tried this one, but it didn't work properly. [CODE] int control(int x1,int y1,int x2, int y2)//x1,y1 and x2,y2 -> coordinates of a …

Software Development c
Member Avatar for D33wakar
0
114
Member Avatar for havoc433

Does anyone now of a regular expression that will omit words in a string while replacing others?

Software Development java
Member Avatar for havoc433
0
166
Member Avatar for nickliutw

I'm running to compiler error while I'm trying to use Enum to create a program that display a deck of cards. The compiler mistake is "Cannot find symbol", but I did call the constructor and use method call to call the method in card class. It still give me compiler …

Software Development java
Member Avatar for ~s.o.s~
0
204
Member Avatar for walid86

hi, i have a panel with controls and richtextbox's within it. When the user clicks the save button, i take panel1 and DrawToBitmap, then add the image to a pdf created using abcPDF7. My problem is that i have recently change textbox's with richTextBox's to enable the user more functionality, …

Software Development pdf
Member Avatar for walid86
0
363
Member Avatar for jdm

I'm working on a program that will find the prime factors to an unsigned integer that is entered by the user. I just have to make sure the program can handle a number up to 1000. I'm writing assembly in x86. I have already got a prompt for the user …

Software Development assembly
Member Avatar for jdm
0
4K
Member Avatar for Syrne

Hey guys. I am getting a fair amount of errors when trying to create this menu. I am not sure whether or not I am going about it correctly. Without further adieu: [CODE]package assignment.pkg2; import java.util.Scanner; public class Assignment2 { public static final int MAX_NUM = 10; public static void …

Software Development java
Member Avatar for Taywin
0
153
Member Avatar for lbgladson

I have an assignment to reverse the sequence of coins in a purse. I cannot use any methods from the Collections or Arrays Class. I have the following code but have no idea what to do from here to get the purse contents to reverse. [code] import java.util.ArrayList; public class …

Software Development java
Member Avatar for Taywin
0
172
Member Avatar for Wilha

My goal is to output monthly cost insrance for entered employee id, but my program keeps giving me a error idk why [CODE]import sys #empfile=raw_input("Enter Emp.file Name:") #emp=sys.argv[1] #print emp #usage : run it as follows from command line. #python db.py employee.txt InsurancePlans.txt InsurancePolicies.txt def dict2(lines): dict={} for l in …

Software Development python
0
86
Member Avatar for TheFearful

Hey, guys. I'm new to this forum and this is my first post ever on this site. I am currently a freshman in Penn State University and I am having trouble with my C++ class. I have a group project but have no idea where to start with this program …

Software Development c++
Member Avatar for TheFearful
0
463
Member Avatar for minimi

Here is the instruction to the assignment: [url]http://dl.dropbox.com/u/43732846/Instruction.txt[/url] I think I got up to the part to initialize array and set length to 0 but I'm not sure how to do a for loop to print. I tried like strlen(month), printf(month[i]), etc, but none of them seems to work. And …

Software Development c data-structure
Member Avatar for hkdani
0
135
Member Avatar for wissam.ashkar

Hello, I am updating a DataGridView using [CODE](dAdapter).Update(dTable);[/CODE] How to check if update is done successfully in order to display a message box.

Software Development
Member Avatar for wissam.ashkar
0
80
Member Avatar for jen140

Hello. I've been doing a small application that will go (using only unsigned integer values) from 0 to 4026531840 and print them out. My code is next: [CODE]#include <stdio.h> #include <inttypes.h> int main(void){ uint64_t cnt; for(cnt=0;cnt<=4026531840;cnt++){ printf("%d\n",cnt); } } [/CODE] The only problem that i have is the last numbers …

Software Development c debian
Member Avatar for jen140
0
187
Member Avatar for gahhon

[CODE] public class Planet { private String planetName; private int travelDay; public Planet(){ planetName = "Earth"; travelDay = 365; } public Planet(String planetName, int travelDay){ this.planetName = planetName; this.travelDay = travelDay; } public void setPlanetName(String planetName){ this.planetName = planetName; } public String getPlanetName(){ return planetName; } public void setTravelDay(int travelDay){ …

Software Development java
Member Avatar for gahhon
0
130
Member Avatar for stereomatching

[code] void test(std:shared_ptr<some_type> A) {.....} [/code] would make a copy of a shared_ptr what if we pass a shared_ptr into a function like [code] void test(std:shared_ptr<some_type> const &A) {.....} [/code] Is this safe? Thanks a lot

Software Development c++
Member Avatar for stereomatching
0
190

The End.