388 Posted Topics
Re: You are declared panelCenter2, but you still add buttons to panelCenter. | |
Re: Line 17 - infinite loop caused by i-- [CODE]for (int n = 4; n > 0; n--) {[/CODE] | |
Re: [URL="http://lxr.js-home.org/lxr/source/"]http://lxr.js-home.org/lxr/source/[/URL] | |
Re: Let's view result [CODE] ProcessBuilder pb = new ProcessBuilder("calc.exe"); System.out.println(pb.getClass()); //even if you write Object p = pb.start();// Object or not object? System.out.println(p.getClass()); proc[choice] = (Process)p; System.out.println(proc[choice].getClass());[/CODE] where proc is declared as Process array (Ezzaral point of view). | |
Re: IP Network Camera What is an IP Network Camera? [URL="http://www.networkcamerareviews.com/whatisanetworkcamera.html"]http://www.networkcamerareviews.com/whatisanetworkcamera.html[/URL] | |
Re: Swingscape.java [URL="http://www.csie.ntu.edu.tw/~piaip/docs/Swing/Chapter27html/"]http://www.csie.ntu.edu.tw/~piaip/docs/Swing/Chapter27html/[/URL] | |
Re: Make your frame class as SINGLETON. getInstance() always return the same instance [CODE=java]package shashikant; import javax.swing.*; public class MyFrame { private static JFrame f2; private static MyFrame thisClass; private static final String str = "<html>" + " ... " + "</html>"; private MyFrame() { JLabel strLabel; JPanel p2; JScrollPane jsp; … | |
Re: e.getSource() can't be at the same time show_pie AND option1. | |
Re: Overwrite method [CODE] public String toString() {...[/CODE] inside class Area. | |
Re: Check: [CODE]System.out.println(form.getClass());[/CODE] Tray: [CODE] public static void main(String args[]) { List list = new ArrayList(); list.add(new Point(3, 4)); System.out.println(list.getClass()); Object ob = list; System.out.println(ob.getClass()); ArrayList al = (ArrayList) ob; System.out.println(al.getClass()); List list2 = (List) ob; System.out.println(list2.getClass()); AbstractList abstl = (AbstractList) ob; System.out.println(abstl.getClass()); AbstractCollection ac = (AbstractCollection) ob; System.out.println(ac.getClass()); Object[] objArr … | |
Re: try look here [URL="http://www.openports.de/luebken/wordpress/?p=24"]http://www.openports.de/luebken/wordpress/?p=24[/URL] or [URL="http://javaboutique.internet.com/TreeTable/"]http://javaboutique.internet.com/TreeTable/[/URL] | |
Re: Based on the swing Sun example: [CODE=java]public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { //FFGen gui = new FFGen(); new FFGen(); } }); }[/CODE] Write constructor for FFGen: [CODE=java]public FFGen() { First(); … | |
Re: [URL="http://www.j2ee.me/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html"]http://www.j2ee.me/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html[/URL] [CODE]newred = newgreen = newblue = 0.3 * red + 0.6 * green + 0.1 *blue[/CODE] | |
Re: Redefine [icode]public String toString()[/icode] methods in tree and node | |
Re: [quote]char array works perfectly[/quote] by default. Write own methods to dump arrays. | |
| |
Re: via additional ActionListener [code=java] public C2() { c1 = new C1(); add(c1); c1.addMyListener(new MyAction()); } private class MyAction implements ActionListener { public void actionPerformed(ActionEvent e) { evaluate(); System.out.println("MyAction " + e); } } [/code] class C1: [code=java] public void addMyListener(ActionListener myAction) { // TODO add .... listener } [/code] | |
Re: If JTextArea is not necessary as EditModel: Change to [icode] class EditModel extends JTextPane{ [/icode] Now, you can simply write [icode] JMenu fontSize = new JMenu("fontSize"); fontSize.add(new StyledEditorKit.FontSizeAction("16", 16)); mbar.add(fontSize); [/icode] or define Size16MenuItem class [code=java] class Size16MenuItem extends EditorMenuItem { private static final Action act = new StyledEditorKit.FontSizeAction("16", 16); … | |
Re: Line 162 [icode] //call sort method Arrays.sort(grades); System.out.println("current size of grades array is " + grades.length); // grades(grades); addTextToTextPane(); [/icode] missing addText | |
Re: 1.What about model of JList? 2.Forced repaint() method? | |
Re: Convert integer number to String. Length of of this String gives you info, how many digits are. Create int[string.length()] array. Use loop to transcribe all values. On fly convert particular values to int. Find a better solution (using % and / operators). | |
![]() | Re: [URL="http://www.daniweb.com/forums/post953719.html#post953719"]http://www.daniweb.com/forums/post953719.html#post953719[/URL] ![]() |
Re: You lost same code after [icode] integer element = scanFile.nextInt(); ..... [/icode] Look to adatapost#6 reply | |
Re: [URL="http://en.wikipedia.org/wiki/Root_mean_square"]http://en.wikipedia.org/wiki/Root_mean_square[/URL] | |
Re: [code=java] package demo; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.awt.*; //http://www.daniweb.com/forums/thread220873.html public class NewClass { public static void main(String[] args) { class SButton extends Button { SButton(String name) { super(name); } @Override public Dimension getPreferredSize() { return new Dimension(100, 40); } } Frame … | |
Re: Use javax.imageio.ImageIO.read( function, [code=java] ... java.lang.String s1 = "IMAGES/Question.gif"; URL url = getClass().getClassLoader().getResource(s1); try { image = javax.imageio.ImageIO.read(url); } catch (IOException ex) { System.out.println("IOException No Image"); } ... [/code] run: The function is to use object BufferedImage@18fef3d: type = 12 IndexColorModel: #pixelBits = 4 numComponents = 4 color space = … | |
Re: "Everything is in your hands" [URL="http://www.daniweb.com/forums/thread208589.html"]http://www.daniweb.com/forums/thread208589.html[/URL] | |
Re: change [icode] try { // Robot r = new Robot(); r.delay(500); r.keyPress(KeyEvent.VK_7); } catch (AWTException e) { e.printStackTrace(); } [/icode] & try again [quote] i tried robot class but it always give me an error [/quote] Error always is the source of information , carefully analyze it | |
Re: First thing , You should do, is write on paper math equation month by month. | |
Re: [icode] String[] splitPath = line.split("\\\\"); [/icode] | |
Re: Inside PicturePanel : remove all conditions [icode] //if (e.getSource() == RunProgram.pic1) {/... or //if (e.getSource() == RunProgram.pic2) {/... [/icode] and by default initilaize eL1 in constructor: [icode] eL1 = new Point(0, 0); [/icode] to avoid NullPoiterException It should work! Later reduce doubled number or varibles , for example pointsLeft/pointsRight , … | |
Re: Implement interface Comparable [code=java] package demo; import java.util.HashMap; import java.util.Map; import java.util.Set; public class XTWO implements Comparable<XTWO> { int a; int b; XTWO(int a, int b) { this.a = a; this.b = b; } //not fully implemented and // "Note: this class has a natural ordering that is inconsistent with … | |
Re: As start work use this templates [code=java] import javax.swing.JApplet; public class YesNoDialog extends JApplet { /** * Initialization method that will be called after the applet is loaded * into the browser. */ public void init() { // TODO start asynchronous download of heavy resources } // TODO overwrite start(), … | |
Re: some tricky, but looks like iconified [code=java] package demo; import java.awt.AWTEvent; import java.awt.BorderLayout; import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JRootPane; import javax.swing.SwingUtilities; class BadPixelFrame extends JFrame implements KeyListener { public BadPixelFrame(String filename, int waitTime) { setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.NONE); … | |
Re: Place Your public static void main(String[] args) method in separate file Starter.java and build program from scratch. quuba | |
Re: 1. add KeyListener to target [code=java] target.addKeyListener(new KeyListener() {... [/code] or 2. use direct method [code=java] // BUTTON ARRAY LISTENER for (i = 0; i < keyName.length; i++) { button[i].addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //j3c String s = target.getText() + e.getActionCommand(); target.setText(s); //target.dispatchEvent(new KeyEvent(target, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, … | |
Re: I have not experience in this theme. [url]http://www.springsource.com/files/uploads/all/pdf_files/news_event/Inside_the_JVM.pdf[/url] [url]http://www.yourkit.com/docs/net40/help/memory_leaks.jsp[/url] | |
Re: add buttons same as txtfields or labels | |
Re: Too abstract. Make zip appendix of netbeans project and post it. "The devil is in the details" | |
| |
Re: ReadLine program can read txt files with max. 8 lines without errors. Your File.txt contains only four lines. Check it. | |
Re: This work! At and of actionPerformed insert line System.out.printLine.setText("isLeftToRight " + area.getComponentOrientation().isLeftToRight()); Apply: // area = new javax.swing.JTextArea(); jTextField1 = new javax.swing.JTextField(); area.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); area.setColumns(20); area.setRows(5); area.setText("012345"+'\u0660'+'\u0661'+'\u0662'+'\u0663'+'\u0664'+'\u0665'); // But I think, this is not what you expect. | |
Re: I working on Windows XP platform, and I am able to get the popup for this JTree. From api doc java: [code] public boolean isPopupTrigger() Note: Popup menus are triggered differently on different systems. Therefore, isPopupTrigger should be checked in both mousePressed and mouseReleased for proper cross-platform functionality.[/code] Check Bruce … | |
Re: Hello Greg try get/set methods: [code=java] //package com.toedter.calendar.JCalendar; public static void main(String[] s) { JFrame frame = new JFrame("JCalendar"); JCalendar jcalendar = new JCalendar(); frame.getContentPane().add(jcalendar); frame.pack(); frame.setVisible(true); //1. Date date = jcalendar.getDate(); System.out.println(date); //2. //second calendar JFrame frame2 = new JFrame("JCalendar2"); JCalendar jcalendar2 = new JCalendar(); frame2.getContentPane().add(jcalendar2); frame2.pack(); frame2.setVisible(true); int … | |
Re: Some of varibles are not initialized [code=java] public class LifeGameJFrame extends javax.swing.JFrame { //.. private void initComponents() { board1 = new ce.board.Board(); lifeBean1 = new ce.ass2.LifeBean(); lifeBean1.setBoard(board1); tickerBean1 = new ce.ass2.TickerBean(); tickerBean1.setLifeBean(lifeBean1);//j3c jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); //... } } [/code] and throws … | |
Re: In Hangman paintComponent(Graphics g) erase the background first. | |
Re: In [icode]public void drawFractal(Graphics g, Point a, Point b, Point c){[/icode] use a,b,c as base to set a 3 new (a1,a2,a3) points of division. Use this 6 points to describe 3 new triangles. Post this fragment. | |
Re: [URL="http://darnok.org/programming/motion-detection/"]http://darnok.org/programming/motion-detection/[/URL] [URL="http://www.walking-productions.com/school/misc/VideoByPixelJMF.java"]http://www.walking-productions.com/school/misc/VideoByPixelJMF.java[/URL] I had no problems with start-up. |
The End.