Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
28% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
3
Posts with Downvotes
2
Downvoting Members
3
1 Commented Post
0 Endorsements
~18.8K People Reached
Favorite Forums
Favorite Tags
Member Avatar for ali11

Hi I am trying to move JTabbedPane down below top panel.I want it where the bottom panel begin.Thanks. import java.awt.*; import javax.swing.*; public class GridBagLayoutTest { JPanel bottomPanel; JPanel topPanel; public GridBagLayoutTest() { JFrame frame = new JFrame("GridBag Layout Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationByPlatform(true); JTabbedPane tabbed=new JTabbedPane(); tabbed.add(bottomPanel,"One Way"); tabbed.setBounds(12, 200, 20, …

Member Avatar for JamesCherrill
0
183
Member Avatar for ali11

Hi I am creating a program in which I have 2 tabs. I want to make my tabs bigger in size so they can take whole panel space. Is there any way I can make both tabs size bigger. thanks import java.awt.*; import static java.awt.Font.BOLD; import java.awt.event.*; import java.awt.event.*; import …

Member Avatar for JamesCherrill
0
2K
Member Avatar for ali11

Hi i am trying to make taxi meter which shows the current price.Rightnow I have to click startmeter afterevery 1 minute than it's update the new price but I want it to update automatically once the price change after 1 minute instead of me pressing startmeter everytime.thanks for your help. …

Member Avatar for stultuske
0
147
Member Avatar for ali11

File f=new File("c:/'.'"); // I know about file class just didn't understand what kind of file "c:/'.'" is. File strRoot[]=f.listRoots();

Member Avatar for JamesCherrill
0
108
Member Avatar for ali11

GregorianCalendar cal = new GregorianCalendar(year, month, 1); nod = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); som = cal.get(GregorianCalendar.DAY_OF_WEEK); for (int i=1; i<=nod; i++){// plz explain this line int row = new Integer((i+som-2)/7); // plz explain this line. int column = (i+som-2)%7;// also this line. mtblCalendar.setValueAt(i, row, column);

Member Avatar for JamesCherrill
0
131
Member Avatar for ali11

everything is working fine except Encryption button. import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; public class encryption extends JPanel implements ActionListener { char [] str= {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' }; char [] str1={'1','2','3','4','5','6','7','8','9','0','!','@','#','$','%','^','&','*','(','_','_','+','=',',','.','?'}; char [] a= new char [50]; char [] b= new char …

Member Avatar for JamesCherrill
0
273
Member Avatar for ali11

JMenuItem mItem[] ={copy,paste}; for(int b=0;b<mItem.length;b++) { mItem[b].addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { String mItemCommand = e.getActionCommand(); JTextArea copypaste = new JTextArea(scr.getText()); if(mItemCommand=="Copy"){ copypaste.select(0,scr.getText().length()); copypaste.copy(); } if(mItemCommand=="Paste"){ copypaste.setText(""); copypaste.paste(); String num =copypaste.getText(); try{double n=Double.parseDouble(num); if(num.indexOf(".")!=-1) isDecimal = false; isFirstDigit = false; if( n-((long)n)>0.0) // I just didn't understand codes starting …

Member Avatar for Taywin
0
128
Member Avatar for ali11

Can someobody tell me why i only see blank window. import java.awt.*; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; public class dic extends JFrame{ public JLabel label1,label2,label3,label4,label5,titlel; public JTextField ew,fw; public JTextArea txar1,txar2; public JPanel …

Member Avatar for JamesCherrill
0
213
Member Avatar for ali11

getting following error: incompatible types: vmpr cannot be converted to JFrame JFrame VendingMachine = new vmpr(); import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JLabel; import java.awt.*; import javax.swing.*; import javax.swing.JFrame; public class vmgu extends JFrame implements ActionListener { public JButton button[]; public JLabel label; public JLabel label2; public …

Member Avatar for stultuske
0
334
Member Avatar for ali11

import java.util.ArrayList; import javax.swing.JOptionPane; public class ClientList { private ArrayList<Client> clientData; private final String NEW_LINE = "\n"; private int cursor; //manager mode public ClientList ( ) { clientData = new ArrayList<Client> ( ); buildClientList ( ); if (clientData.size ( ) != 0) cursor = 0; //not empty, place cursor at …

Member Avatar for Slavi
0
171
Member Avatar for ali11

error: no suitable method found for toArray(int[]) return intList.toArray(new int[intList.size()]); ^ method Collection.<T#1>toArray(T#1[]) is not applicable (inference variable T#1 has incompatible bounds equality constraints: int upper bounds: Object) method List.<T#2>toArray(T#2[]) is not applicable (inference variable T#2 has incompatible bounds equality constraints: int upper bounds: Object) method AbstractCollection.<T#3>toArray(T#3[]) is not applicable …

Member Avatar for jwenting
0
3K
Member Avatar for ali11

*getting following error. duplicate found Exception in thread "main" java.lang.NullPointerException at binarysearchtree.main(binarysearchtree.java:185) Java Result: 1 here is my code* public class node<T> { public node<T> root ; public T data; public node left; public node right; public node (T newData) { data = newData; left = null; right = null; …

Member Avatar for Taywin
0
411
Member Avatar for ali11

i just learn about single linkedlist and i am trying to create a program. public class linklis { public static void main(String[] args) { LinkedList ab= new LinkedList(); ab.add("1"); ab.add("2"); ab.add("4"); ab.add("7"); System.out.println("the list" + ab); System.out.println("remove 2nd element: " + ab.Delete(2)); System.out.println(" - print linkedlist size: " + ab.size()); …

Member Avatar for stultuske
0
275
Member Avatar for ali11

//************************************ //Includes #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> //************************************ //Globals int packed; //************************************ //Function Prototypes int pack_value(int value, int size, int low_bit); int unpack_value(int holder, int size, int low_bit); void get_date(int holder, int day, int month, int year); void get_permissions(int permission, int clas, int *read , int *write …

Member Avatar for Adak
0
130
Member Avatar for ali11

how can i replace the array notation with pointer notation #include<stdio.h> #include<stdlib.h> #include <math.h> /* 4 */ void run_sieve(char *, int); /* 5 */ void print_primes(char *, int); /* 6 */ int main() { /* 7 */ int i, top; /* 8 */ printf("compute primes up to: "); /* 9 …

Member Avatar for -[xxxxxxx]-
0
245
Member Avatar for ali11

import java.util.Arrays; import java.util.List; import java.util.Random; class DynamicArrayOfInts { private int[] storage; private int size; private final int INITIAL_CAPACITY = 8; private final int GROW_FACTOR = 2; public DynamicArrayOfInts() { storage = new int[INITIAL_CAPACITY]; size = 0; } private void rangeCheck(int index){ if (index < 0 || index >= size) …

Member Avatar for Taywin
0
242
Member Avatar for ali11

I am receiving this error markup.c: In function ‘GetPrice’: markup.c:16:23: error: ‘markup’ undeclared (first use in this function) markup.c:16:23: note: each undeclared identifier is reported only once for each function it appears in markup.c:17:1: error: ‘output’ undeclared (first use in this function) here is my codes // File: markup.c #include<stdio.h> …

Member Avatar for VatooVatoo
0
186
Member Avatar for ali11

Note: C:\Users\Hamza\Desktop\Graph.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Tool completed successfully [CODE]import java.io.InputStream; import java.net.URL; import java.util.*; import java.awt.*; import java.applet.Applet; class Node { double x; double y; int lane; int road; double dx; double dy; String lbl; int carW; int carL; double carWaiting; …

Member Avatar for JamesCherrill
0
140
Member Avatar for ali11

need help to add main class to test this program. [CODE]public class Rational { private int num; private int den; public Rational ( ) { num = 0; den = 1; } public Rational (int a, int B) { num = a; den = b; simplify ( ); } private …

Member Avatar for jwenting
0
196
Member Avatar for ali11

Hi i m trying to design a program using object oriented approach.everything works perfect for me except the bounces.If the new height is less then 0 then multiply both the height and velocity by -0.5 to simulate the bounce. [CODE]import java.util.Scanner; public class Ball11 { public static void main (String …

Member Avatar for zeroliken
0
271
Member Avatar for ali11

Re-design the program using the object-oriented approach - Allow the user to play the ball as many times as he wants and each time he can decide the initial ball speed and the number of bounces to stop the ball here is what i did before. [CODE]import java.util.Scanner; public class …

Member Avatar for peter_budo
-2
130
Member Avatar for ali11

can somebody help. i m getting following errors. i m creating postfix calc C:\Users\Hamza\Pictures\CalcGUIPanel.java:204: int cannot be dereferenced Integer arg2=resultValue.pop(); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: int cannot be dereferenced resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: operator + cannot be applied to <any>,java.lang.Integer resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: int cannot be dereferenced resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:211: int cannot be dereferenced …

Member Avatar for JamesCherrill
0
139
Member Avatar for ali11

I m new.I am not getting any result for Number of A Number of B Numbers of C Number of D number of F for A,B,C,D,F i always get 0. [CODE]import java.util.Scanner; public class ExamScores1 { public static void main (String[]args) { String a; int count= 0; int grade=0; // …

Member Avatar for hfx642
0
146
Member Avatar for ali11

Hi i am looking for following output.I am just getting 0 for a,b,c,d,f. total no of grades Number of A's Number of B Numbers of C Number of D number of F [CODE]import java.util.Scanner; public class ExamScores { public static void main (String[]args) { String a; int count= 0; int …

Member Avatar for Rzink92
0
135
Member Avatar for ali11

Hi i m creating simple rpn calculator.I m getting following errors. C:\Users\Hamza\Pictures\CalcGUIPanel.java:63: array required, but java.lang.String found cStack.push(buttonOrder[i]); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:213: currentValue is already defined in actionPerformed(java.awt.event.ActionEvent) BigInteger currentValue = new BigInteger(cStack.pop()); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:215: operator + cannot be applied to java.math.BigInteger,java.math.BigInteger resultValue += currentValue; ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:223: currentValue is already defined in …

Member Avatar for NormR1
0
264
Member Avatar for ali11

Hi i am looking for following output.I am not getting these. System.out.println(total no of grades) Number of A's Number of B Numbers of C Number of D number of F [CODE]import java.util.Scanner; public class ExamScores { public static void main (String[]args) { String a; int count= 0; String word; int …

Member Avatar for ali11
1
5K
Member Avatar for ali11

can someone help me to fix my codes.I am receving some errors.This is my first time i am using stack in GUI. [CODE]import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.Scanner; public class CalcGUIPanel extends JPanel { //=============================================== instance variables //--\- Component referenced during execution private JTextField …

Member Avatar for NormR1
-1
217
Member Avatar for ali11

First i create simple claculator.but now I am trying to change it to RPN calculator by using stack.Can some one help me because I don't know alot about stack.here is my codes so far. [CODE] import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.Scanner; public class CalcGUIPanel …

0
83
Member Avatar for ali11

can somebody help me with switch statement. [CODE] import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; import java.util.Vector; public class Ahsan extends JFrame{ Stack s = new Stack(); private JFrame f; private JPanel p1,p2; private final int ADD = 1; private final int SUBTRACT = 2; // declare …

Member Avatar for JeffGrigg
0
2K
Member Avatar for ali11

First i create simple claculator.but now I am trying to change it to RPN calculator by using stack.Can some one help me((especially where to use pop method) because I don't know alot about stack.here is my codes so far. import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import …

Member Avatar for ali11
0
137