Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

william brown

Greenhorn
+ Follow
since Jul 19, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by william brown

Hi,

Let say I hava a value 245.678909. I want to display it as 245.68. It is a double value. What should I do?

Thank you.
15 years ago
Yes.. it is a standalone program.. what should i do with that *.class files. How do I run it..
15 years ago
Hi,

This might be a very simple question. I have developed a JAVA program and I want to run it on other computer with different Operating system (UNIX). This means that I dont have to compile the program again.

What should I do? What do the other computer must have in order to be able to run my program?
15 years ago
Yes. The paintComponent()will be called whenever I start to call the class, or minimizing the window any any other operation.. but not when I try to call it through doSomething().
15 years ago
Hi,

I've created a class that extends a JPanel and I have override the paintComponent() method. The problem is, whenever I call a repaint() from another method ( doSomething()), the paintComponent() was not called. The doSomething() method is called when user click a button after he/she insert the 'a' and 'b' value into 2 textfields.
Why is that?

here is some of my code:

int x, y;

public void doSomething(int a, int b)
{
x = a;
y = b;
repaint();
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawLine(x,y,x+50,y+50);
}

Any idea or suggestion??
15 years ago
Yes. You are right Mr Gregg Bolinger. I just want to get more idea from the answers because I dont think everybody here are also in the other forums. Sorry if you dont feel happy with it, Mr Michael Dunn.

Thank you Mr Gregg Bolinger for your good idea. You have really helped me.
15 years ago
Hi,

I want to put a canvas in a JPanel so that I can do some drawing. The canvas must cover the entire space of the JPanel. Whenever I resize the JPanel, the canvas must also be resized.

I think I have to set the size (setSize) of the canvas. But I don't know how to get the size of the JPanel.

Or is there any other better way (on setting the size of the canvas) ?

Thank you.
15 years ago
Thank you very much. I've used the validate(), remove() things and it works well. But using card layout is also a good choice. I might change to that alternative if there is any problem with my program later.
15 years ago
Hi,

Do JAVA provide complex number operation class?
15 years ago
Hi

I want to create a dynamic panel that contains a comboBox and an inner panel. Whenever I select a value from the combobox, the inner panel will change to display different things.

It looks like I have to use CardLayout. Do I have other alternative?.. maybe using any repainting or whatever methods available?
15 years ago
Yeah. You are right. I should use JDialog.

Thank you
15 years ago
Hi

I plan to create a modal dialog box that can accept few input parameters.

Maybe like a frame that can contains all sorts of components like tabbedPane, Buttons, etc BUT acts like a dialog box, means that I have to click a button in the main frame before the "dialog box" can appear and I have to click either "OK" or "Cancel" to close the "dialog box" + (it is modal).

I learned that JOptionPane.showInputDialog can just accept 1 line of input argument as String. I dont want user to key in all the input parameters in one string of text. And I dont want to have few dialog boxes in sucession in order to accept few input parameters from the user.


I hope to find a modal dialog box where I can organise the position of any of the labels and textField and accepts various kinds of input parameters.


Any suggestion?

Thank you.
15 years ago
Can I use Java2D with Java Swing .. or is it just for Java AWT?
15 years ago
Hi,

I need a guide here. I want to develop a program to simulate a simple logic circuit (AND, OR, NAND, NOR, XOR, XNOR gates). Here are the properties of the program. (These gates are images):

  • There is a dialog box containing all the gates where I can select which gate to use and drag it onto the display area.
  • The gates on the display area can be connected through lines.
  • The circuit can accept input bits
  • The circuit can compute the output bits given the input bits
  • I can open an input file (probably XML) that contains a circuit and display it on the display area and run simulation on it.


  • So, what Java Swing components that I can use to display the circuit?

    What component of Java Swing that support XML file manipulation?

    Any other advice??

    Thank you.
    15 years ago