- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
34 Posted Topics
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, … | |
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 … | |
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. … | |
File f=new File("c:/'.'"); // I know about file class just didn't understand what kind of file "c:/'.'" is. File strRoot[]=f.listRoots(); | |
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); | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
*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; … | |
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()); … | |
//************************************ //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 … | |
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 … | |
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) … | |
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> … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; // … ![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
I have no idea what wrong my cods when I press = button of my calculator nothing happens. [CODE]import java.util.Stack; 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 JTextField … | |
I need help in creating a RPN calculator! I'm currently stuck in making a stack. here is my codes so for.This is my first time I am using stack. [code] import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; public class JavaCalculator extends JFrame{ Stack s = new Stack(); … | |
I need help in creating a RPN calculator! I'm currently stuck in making a stack. here is my codes so for. [CODE]/** * * * */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.math.*; public class JavaCalculator extends JFrame{ private JFrame f; private JPanel p1,p2; private JTextField jtfMain; private JButton … | |
I did it without using GUI because i am not sure how to do in GUI.I need help to put these code in GUI. [code]import java.util.Scanner; import java.util.Stack; /** This calculator uses the reverse polish notation. */ public class Calculator { public static void main(String[] args) { Scanner in = … |
The End.