I need a veritical progress bar in swing to display a temperature in one case and a voltage in another. How can I accomplish this?
Can I set the progress bar to a vertical mode?
Can I use the slider control in a read only mode in which it id not adjustable? I was thinking I could simply set the slider to the actual value when the user...
I have taken a JPanel (say cardsPanel) and have set its layout as CardsLayout. After that I have added 3 cards on it (say card1, card2, and card3) all of JPanel type.
Now I want to get the topmost card of the cardsPanel whenever a user clicks on a button "Show".
So, How can I get the top-most card of the cardsPanel.
...
Hi,
these are my classes.when i run my MainClient class,one frame will be shown that get text from client and then send it to the server.at the first time when i click on the Send button,it will work correctly and send data to the server but suddenly the frame will confused and I can not do any thing like writing or clicking on the butto...
Java uses period in decimals, e.g. 1/2 = 0.5
Is there any way to make it use comma instead, as in 1/2 = 0,5? And not to use comma for thousands (as in one hundred thousand = 100,000) but use space instead (100 000)?
When it comes to output I suppose I could use all sorts of string format functions, but the problem is input (JTable). ...
I am doing an animator showing a series of .jpg. The animator is a thread which is running as it is updating the other JLabel which I use to display text. But it just will not repaint the ImageIcon. The thread class is txAnimate. What's wrong?
public class main extends JFrame implements ActionListener, ItemListener, ChangeListener {
...
I have a swing application and I want to present a confirmation box to user before the application is closed on windows shutdown and if the user selects cancel, the shutdown process should abort.
I went through couple of discussions in the forum but couldnt get a concrete answer. If anybody has successfully implemented this requirement,...
Sorry, for double posting, already posted this question once, but I realized I weren't explicit enough. I still haven't managed to find an answer to my question so I'll try to better describe my problem here:
I have the following classes:
public class Paddle extends JLabel {}
public class Canvas extends JPanel implements Runnable {}
...
Sorry for really simple question, but I wasnt able to find anything in the net, probably because I dont know the right terms to look for.
When you have a desktop application, there are many so called children windows: one for options, one for "about" and so on. How to make them in Java Swing (with NetBeans tools - optional)?
So far ...
Ok so lets say I have 3 Jpanels - 1 parent and 2 Children
//Assume necessary imports etc
parent is something like:
public class ParentPanel extends JFrame {
private JPanel mainPanel,controlPanel;
public ParentPanel(){
MainPanel pp= new ParentPanel();
controlPanel cp = new controlPanel();
}
...
Main Panel in real thing is ...
basically my program should display a frame in which a panel draw a point on the screen according to "input" data (integer values) coming from a serial connection on my pc.
The problem is: how to "transfer" values from the serial port to the OTHER class Frame and call the REPAINT() method??????????
Given that via console I receive ever...
Question: Where can I get a list of all UIDefaults properties that exist in Swing?
I know of the possibility to write a small snippet of code that just extracts and displays them but I would like to know whether the list I get that way is really complete.
When I do so, I get 636 properties for the Metal L&F, 613 for Windows L&F and 550 ...
I have created a list of my friends' names. By clicking on their names one frame should get opened for me and a second one on the machine where the friend has the same application running.Just like the chat window in a messenger application. I use the IP address 127.0.0.1 fort this. Will this wor?
this is my list action performed:
priv...
Hi,
this a a part of my code ,but i don't know that why it shows two chat frames for me when i click on the list?
also this is a client/server application with 127.0.0.1 IP address.would you please help me?
private InformationClass client;
private static DefaultListModel model = new DefaultListModel();
private ListSelectionMode...
I am developing a Java Desktop Application. In it I have 4 JButtons on a JPanel. Now I want that whenever a button is clicked its background color changes to some other color (say orange) to represent that it has been clicked and the background color of all other 3 buttons reset to their default color (in case any of them had Orange back...
Does anyone know an automated solution to migrate Oracle Forms to Java desktop forms (e.g. a code generator whose input are Oracle Forms definition files and output is Java code in AWT/Swing/SWT/whatever)?
Preferrably open-source or free, but commercial ones are also a possibility.
...
I have created hundreds of JButton using Netbeans in my Java Desktop App.
Now I want to replace all of them with JToggleButtons.
Can I do that by selecting all the buttons in the "Inspector" window of Netbeans and perform some task?
Is there any short-cut method?
It will take a lot of time to manually replace all of them.
...
I have a text area with some text in it and I want to add some lines to it again, (the first lines + the other lines that I want to add) but it doesn't work.
The way I'm doing it right now erases the old text and shows just the new lines.
...
All I want to do is have a JOptionPane inputDialog with a JTextArea instead of a JTextField.
I tried putting the JTextArea inside of the Message parameter like so
Object[] inputText = new Object[]{new JLabel("Enter Graph Information"),
newJTextArea("",20,10)};
graphInfo=(String)JOptionPane.showInputDial...
I'm using the NetBeans Outline model to create a TreeTable, the technique is described here:
Everything looks nice and clean and I now want add a TreeModelListener to my model to listen for changes in the model:
Outline outline = new Outline();
MyNode root = new MyNode("data", 0);
//...
TreeModel treeMdl = new MyTreeModel(root);
Outli...
It is well known that updating a Swing GUI must be done exclusively in the EDT. Less is advertised that reading stuff from the GUI must/should also be done in the EDT. For instance, let's take ButtonModel's isSelected() method, which tells (for instance) ToggleButton's state ("down" or "up").
In every example I've seen, isSelected() is...