Main Topics
Browse All TopicsHi I have a JFrame to which I am trying to add an image to it. I'm to to this GUI stuff and I'm not sure how to do it. I want to add the image to the JPanel (the blue area). Can anyone help with this?
Hi all,
I'm interested in creating a GUI in Java Swing that allows users to upload files to a web server. I can only use Java/Java Swing, Java servlets allowed and no JSP. Also my http server does not support FTP.
Is it possible to create...
I need some assistance returning the query I wrote into a JList. A worthy example might be enough for me to get the task done.
The code below compiles and connects to the database, so the only task left to do is populate the JList with the data.
hello,
i m using netbeans 6.0.i have a panel,on that panel i hv a scrollpane,on that scrollpane i have dragged n dropprd a jtable.i want to use a combobox in one of the ells and button in another cell.how i can do that?
thnx
hi, i have 3 classes in java.
1)a class that extends Jframe
2)another that extends JPanel
3)a class that holds only the main method
In my main method of my 3rd class, it looks something like this.
but only the JFrame got shown and it seems...
For some reason I can't make the JTextFields fire the property change events when changing the text in the textfields. I followed a guide used on JFormattedTextField on sun.com, but maybe its not the same concept? I have attached the non working...
Hello,
The following code supposed to be setting the Jpanel at the center of the JFrame I have created.
Since the BorderLayOut tries to fill the whole window with the JPanel, it does not do what I want
to happen.
I have set a size for the...
I'm trying to create a data file viewer with an application I'm writing. It works the first time, but if you try to press the button again and change the source file and view another data file, it processes it but does not change the graph....
I am trying to connect to a DB2 on an AS400. I thikn I have that part done, but I am also trying to display the results of the query in a table using the ResultSet method. I keep getting an error saying "Can not Resolve Symbol" on this line...
I'm looking to make a simple JComboBox with Key=Value pairs, i.e. InternalValue=DisplayValue
Example: The combo box options are
S=Save to disk
G=Group into one file
N=Don't Save
If the user chooses "Don't Save", the program...
I'm trying to use a JComboBox that has Images for its items in a JTable column.
When I run the program the combo box is there and usable, but not until I click in the cell.
Before clicking it's empty even though I've used the setSelectedIndex...
Hi Experts,
I constructed a JTree with some data in it.
3 node types: root, ProjectNode, and leaf (string)
I would like to retrieve a leaf's treepath so that I can select it in the JTree.
I can do it for the nodes immediately following root...
Hello,
Here is my GUI: http://people.clarkson.edu
For some reason i could display my examTable on examPanel even though i am not getting any error message.
I am able to print the examID: System.out.println("examRs
Hi all,
i'm using netbeans to create an application, and use the "design" view to add swing elements. When i add the file chooser, i get this large filechooser frame in my application. what i want is to open the jfilechooser (modal dialog)...
Why is the KeyListener ignored in this example?
I have a JPanel in which I placed a JLabel of the same size as the JPanel. I set the icon property of the JLabel to a jpg image file. The image file displays, but it is too large, and needs to be resized.
How do I resize the displayed (in...
Hi, I've tried to modify one of the Demo programs (TableDemo.java) found in the Java Tutorial.
When executed, the *original* program displays a small table that primarily consists of string data within each cell. I've tried to modify the...
Hi,
I am new to netbeans and require the sample code or tutorial for developing Java Swing Applet in netbeans.
Kindly Revert
Hello All, Can anybody provide me with an example, how to convert html file to an image file using Java?
Thanks in advance
resizing image with getScaledInstance I have a great quality loss.
I read also
http://today.java.net/pub/
but i was not able to obtain better results.
Any ideas to perform an image...
hi!
Can anybody take a look this? (It is hard to explain w/o actual applet.)
http://webdev.apl.jhu.edu/
If you drag up the bottom of window, the button disapears. My question is:
Is there two panels in this...
Hi!
I need to put some instructional label on top and three buttons at the bottom. I was thinking creating Jpanels for them and inserting into Jframe, but it doesn’t seems to work and the format is messed up. Can some one show me better ways...
Hi Experts,
I have JTable with 5 columns and one column with check box vales.
I need to select one row at a time and fire event on selection of cells in first 4 columns.
But the last check box column should not select(highlight) the row
i.e...
I'm having trouble getting my JFrame to show when I run my program it just shows me a blank frame. I have my Checkboxes declared but nothing is showing. Help me please
Using a JTable, what event or method is generated/called
when a column is manually resized by the user?
If it's an:
event: What is the listener interface handling the event
method: what is the exact method signature including
...
How is it possible to select a certain treepath in a JTree? I have used the code below, but I get this error.
java.lang.ClassCastExcepti
i am using JTable in my program.during the running time i like to change single row color.how to change..can u give some ideas immediately..bz it's very urgent.
Thankingyou
I'm recently creating a OOP kind of GUI design concept!
first of all, i have a JFrame class, and it's associate with another JPanel class, the JPanel class have a JButton which is open up a JDialog (Note: my JButton is not in the JFrame class)....
im trying to run unix script for example ABQ_MIS_script.sh it dosent work this an update script but when i try to run unix command like ls -ltr it will work how can run the script
I have an undecorated JFrame (which also has a glasspane attached). In my glasspane, I have a mouse adapter listening for drag events to the components that it stores (JLabels with icons). I would like to be able to reposition the JFrame...
I'm working on a JTable with a checkbox column. I have problems with the checkbox column header:
1. The checkbox in the header doesn't work very well. If you click it once, it checks all other boxes as it should, but then it doesnt' work well...
I found this code to create a mutli column jList. It works just fine except for the fact it creates a new form.
I'd like to be able to use this component in a more traditional way. i.e. create the multicolumn aspect and mount it to an existing...
Hello, Is there a way I can put a actionlistener on a JLabel?
Thanks!!
Edit>> To make the label clickable!
I'm playing around with creating an application and I want to create a new window when a button is clicked. I'm new to creating swing apps so I'm wondering what the best way to accomplish this would be and what component would best suite. I have...
How would I go about displaying the results of a simple MySQL select statement in a JTable component in NetBeans 6.0?
Something like this:
select ID, FIRST, LAST from table where variable = 'Y';
Any help would be appreciated!
Mark
I am trying to make an input field and a display text area in netbeans. If I input a number in the input field and press enter then the same number should be displayed in the text area. How Do I do that?
How to compare two images are same or not using java.
For Java Windows AOT compilers, Excelsior JET seems to be the leader. Are there any other competitors to Excelsior JET?
Here is some code:
public class MenuSelection implements ActionListener
{
public void actionPerformed (ActionEvent e);
{
System.out.println("Do something");
}
}
q. Why do I get a "missing method body or...
I'm stuck. I have a JTable that holds a JComboBox which is populated depending on the value in another cell (plain) in the same row. Everything displays correctly, with the correct values in each combo box. The problem is when I make a selection...
hai I want to play the swf file in the Java desktop Applicqaaion,
I triied with the lot of codes but it not work,
Please give me the Solution so that i can sole this poo
I keep getting below exception in Tomcat 5.5, it happens with JNLP as well as on applet client around 5 minute. What could be the reason ?
ClientAbortException: java.net.SocketException: Software caused connection abort: socket write error
...
Experts,
Please help on how can I add/append new row dynamically. I'm using
jTable1.setValueAt("asdf",
to add data to a jTable.
Thanks.
Hello experts,
Have a quick question.
Is it possible to create a horizontal line on a JPanel? I want to do that to make a sepration between two regions on my JPanel...just to give a look and feel to the whole thing. Let me know if its...
The following code has a JTable with 2 columns.
The lst column has JComboBoxes, the 2nd column has JSpinners.
I want to set the spinner values based on the selection of JComboBox.
The JComboBox selections are "small" and "large".
For...
Hello,
I know this is supposed to be easy, i've tried about twenty different ways of doing this, even using code straight from my java book and other sites but for some reason I can't get a clickable image to display. It works when I use an...
Hi! I am new to programming with Java n by extension J2ME. I am trying to write code for a splash screen that displays a screen title at the top of the screen, a picture in the middle of the screen and maybe a line below the picture. Cheers
Hello there,
I have a JTable which has two columns containing dates.is it possible to have a calender pop up when i click on the cell containing the date.
cheers
zolf
Hi Experts,
I have a awt.Component that comes from JMF using MediaPlayer.getVisualCompo
But I need to resize this Component larger than what it is and maintain its Aspect...
I am diplaying an mjeg video to a JPanel inside a JFrame. i can scale the 'images' as needed but i want to fix the overall aspect ratio constant. how can you force the JFrame / JPanel to hold a fixed aspect ratio as the user 'resizes' it?
I am in a preparation phase for making a game, with an interface, like an RTS.
I am using a Mutalisk animated gif to start off my "learning." (code attached) I will use my own graphics later.
I am using a JFrame for the game window, and adding...
I am encountering a 'could not find main class' error. I am launching the application form the main metohd by right clicking and then selecting 'run as' - java application.
All the relevant jars are on the class path - and the error message i...
We have a JPanel that's populated from a database that consists numerous JLabels and JButtons. Is there a way to refresh or clear the JPanel to except new results from click on a JButton from another class?
Basically is there a way to refresh...
How can I exec a program and have the output displayed in the textarea that I've created while running? The code work OK if I pass it simple commands like "dir" etc. but hangs when I start my application. The application I'm running is a java...
Hi, I am designing a GUI with my own custom JTable which has a method to resize the columns in the table, such that the 2nd column fills all of the space that the JTable has available. I have added a listener to the main JFrame to detect when it...
Hi
i have a have a java GUI application
i want to save some file in some place,,, now the problem is that i want the user to locate where to save that file ,, i want something like when u download a file , the browser asked u where to save it...
Hi, I'm trying to add an image to my JPanel, but I cant seem to get it to work... Can you please share some ideas/comments?
Thanks.
I tried adding the following inside the constructor, but it didn't work. I'm just not sure how to do it:
...
hi,
i've searced the web to find a way to set padding on a JPanel, like padding is used in css. But i couldn't find any.
How would i set padding on a jpanel?
Stian
Hello Experts,
having problems running jstat.
here is what I am doing:
jdkDir> jstat -gc processPID 250 2
but it keeps saying that the PID is not found or it throws a java exception. I confirm, via task manager (windows) tomcat's PID...
I have created an application in Netbeans 6.8. When creating it I chose a new Java Desktop Application framework for a Basic Application Shell. Part of the plusses of this project structure was to have a resource management mechanisms to better...
I am trying to remove the etched border around JComboBox in the Metal PLAF. I'd rather not extend any of the PLAF classes, so I've tried using
UIManager.put("ComboBox.bo
with no luck. It seems...
I have the following statement:
newIndex = (int)Math.ceil(i*((sequenc
for example :sequence1.length equal to 6 and X= 7 i =1
newIndex = (int)Math.ceil(1*((6)/7));
but this produce the result equal 0, but I am...
Hey all,
I would like to set a small number of JPanels in my application so that if the window is resized, they have a minimum size that those particulare JPanels can be set to. I tried something like this:
// ...
JPanel pane = new JPanel();...
How can I use JTable to insert my data.
Any complete example is welcome.
hello there,
i have a jtable which gets its data from the db.now i want to be able to edit the details in the cell.how can i do it.example will be appreciated.
cheers
zolf
Hi Experts,
What's the main difference between JButton and Button ? JFrame and Frame ? JLabel and Label ? It seems that JButton, JLabel and JFrame belong to swing and newer .... but .. what are the exact advantages of using them ? Thanks...
Is it possible to clear the contents of a JPanel or JFrame when an action has been performed??... and then fill the JPanel or JFrame with something else?
Hi,
I have a java applet which loads a JFrame
now this JFrame has many components
When I press a button , it loads a JWindow
if this JWindow is visible then I want to hide it
if the user presses either the escape key anywhere in the...
I can use GridBagLayout to define rows of Squares (JPanels) that happen to have each odd-numbered row indented by a half-square to simulate a hex map. I can create a hexagon JPanel by overwriting the paintComponent but it still comes out looking...
I'm trying to add a JTable to my window, but I can't get it to display the header.
Can someone give me detailed instructions how to display a JTable with it's header.
I also need to know how to get it to not be able to edit the columns...
Hello,
I've subclassed the JTable and AbstractTableModel classes in order to create a table with a specific look that would be easy to instantiate.
Anyhow, I can't seem to get the table header to show up and I'm just wondering what I have...
Hi experts, I am developing a stand alone java application using swing. I am new to swing. As per the need i have to put a JTable in my application and make that JTable editable. That is on clicking the add button 1 row should be added to JTable...
Hello freinds,
I want to know how to zoom in/out jpanel and all of its components without disturbing the events assosciated with all of the components inside jpanel.
Thanx in advance.
I include the form feed code \f at the end of my format string but is does not form feed to the next page before it starts printing the balance of the document. Any Ideas
I had implemented a JOptionPane with a JTable where one of the cells in the JTable had a JPopupMenu. The JPopupMenu didn't work in that it was not able to get focus and so nothing could be selected in the list. My guess was that because...
hello there
i want to draw tile image on JLabel while the text will display over this bordered image and the JLabel expanded as the text ended
(Ex. writing Text in a bubble Talk image)
URGENT PLEAASE
i have a JProgressBar which I am using during a Task
is it possible to change the color of progress bar (default is orange to say green) when the process is finished,
thanks
For a given component, is there a difference between:
- calling setFocusable(true) in its constructor
and
- adding this method to the class
@Override
public boolean isFocusable() {
return true;
}
Hi,
I am looking to create a zoom - pan effect on a jpanel with multiple elements in it with various listeners. I can create the zoom-pan effect relatively easily with Graphics2D's transformations and then drawing the panel. However, once...
Hi,
I'm quite new to Java and I'm trying to create an interface in swing that is scalable. I am trying to implement the following design of a board game:
http://www.gliffy.com/pubd
I am trying to make it so the game is...
I'm using java swing to add images into a JList to display images' thumbnail. I get a scaled instance of every image, add them into a DefaultListModel and then add the list model into my JList.But I got that error when adding images:
Exception...
Hello,
I'm trying to add an image as a background on a JPanel to enhance an interface but after editing someone elses code I've come across a problem.
I get a grey box instead of the image it's supposed to display. I've also tried adding...
This is another dumb question from a beginner with a public library book (McGrath Java2 in easy steps)
I want to add a JPanel with an image with it using java.awt. I can achieve this if I don't set a flowLayout to the container, but if I try...
Q tal,
Ive been trying to implement the OOoBeanViewer class in a systems and I cant stop getting problems, when I run it in Eclipse it runs fine as both applet or application, but when I try to use it as an applet it gives me a million of...
I found the listed program on Roseindia.net. Great site I recommend it. Here is the code:
import javax.swing.*;
import java.awt.event.*;
public class ShowDialogBox{
JFrame frame;
public static void main(String[] args){
...
I am currently working on an application that is going to serve as a sales tool for a supply-chain management product.
As part of the demonstration, I want to have a Flash presentation display in a swing component (either a JFrame or a...
hi, I have a small java application that contains a JPanel. In the JPanel I have a JButton. I also created a JFrame Form using NetBeans. Now I have added the ActionListener in my JPanel and all I want to do is when I click on the button in the...
How can i disable a Parent window (JFrame) in java while the child window also a (JFrame) is visible
Workbook wb;
// ...
ByteArrayOutputStream bos = new ByteArrayOutputStream();
wb.write(bos);
InputStream bis = new ByteArrayInputStream(bos.t
Is this a correct way to convert output stream to input stream actually the...
Anyone know how to create a directory tree using swing in Java?This tree is used for scaning all computer hard drive and directories inside each drive.
JTable.getCellEditor() seems to be called the first time a given cell is clicked on and never again.
Is this correct?
How do I get the table & scroll pane to stretch to fill the panel as it is resized?
(Resized using the mouse).
Ola!
I have a swing frame and different components on it. Layout manager is GridBagLayout. What I want to do is when any component is selected (has focus) I would like to draw a red border around the cell of GridBagLayout which contains that...
Hi,
Does anyone have an example program where a frame consists of multiple panels where the layout is null (i.e. you can setLocation and setSize for the components within the frame and panels)???
Please help me!
Thanks guys,
Roy.
hi,
I want to refresh a JTable with another JTable values. How can i do that? Basically i want to copy the values from a backup JTable to another JTable which is being displayed on the screen, on some event like a button press.
I did the...
I'm trying invoke a JForm Panel by clicking a button on a Java Desktop Application. In the event action listener of the button i have created an object of the JForm class and have set it to be visible. The program does not give any errors, but...
Experts,
I am plotting radar tracks onto a panel. I do this my iterating through a container and painting the coordinates of the aircraft that exist at the particular time increment. The effect is miving dots across the screen - similar to a...
I am having trouble showing a simple animation in a Java application. I paint several circles separated by repaint and sleep requests but I only see the last one, not the intermediate ones. The attached code displays a single "circle" at...
How can I orientate my JLabel vertically
(Like for a JSlider:
JSlider.setOrientation(JSl
Please help me ???
Hi experts,
In the attached code, I need to have the following options
1) get the name(eg;first.doc) of the selected item/items.
2) When I right click on top of a particular item, I need to have that item alone selected.
3) I need to have no...
zzynx
2,000
0 points yesterday
Profilemccarl
2,000
0 points yesterday
Profile