26 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for dsmush

[SIZE=4][FONT=Arial]Hi, I'm creating an application that makes use of the GridBagLayout as it is the most useful layout manager for what I need. I made a JPanel and added it to the frame. The result I'm currently getting during run-time is a JFrame with a JPanel placed in the center. …

Member Avatar for Toby_6
1
3K
Member Avatar for Doogledude123

Flickering occurs when Active Rendering with JPanel, not sure why as I've done this before (couldn't find source code of that project however). Relevant Code: Graphics g = projectDCWindow.getWindowGraphics(); // Gets the Graphics Object from a JFrame g.setColor(Color.BLACK); g.fillRect(0, 0, (int) ProjectDCInfo.getDefaultWindowSize().getWidth(), (int) ProjectDCInfo.getDefaultWindowSize().getHeight()); // Clears the screen projectDCGSM.get().render(g); // …

Member Avatar for Doogledude123
0
2K
Member Avatar for Doogledude123

I was wondering if it would be more efficient to render a single BufferedImage instead of rendering a bunch of BufferedImages in a double for loop? I have an idea of how to do it, I just don't know what methods in BufferedImage you would use to create the bigger …

Member Avatar for JamesCherrill
0
285
Member Avatar for CoilFyzx

Hello good day. I have an idea for my program. I have a Table in my display. I want to add a Component to - let's say - the right of my screen. When I click this component it should display to me buttons and other components that I have …

Member Avatar for JamesCherrill
0
528
Member Avatar for ferizhandi

I am writing a application.and i need to draw line in jpanel.but it is crash when jpanel add to jframe.this is my code: public class Simplification extends JFrame { JPanel panel; public Simplification(List<List<Integer>> transmitionTable , List<List<Integer>> outTable) { this.setTitle("Simplification Result"); this.setSize(500, 300); this.setLocation(50, 50); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); // do other jobs …

Member Avatar for JamesCherrill
0
216
Member Avatar for CoilFyzx

Hello Good day. I have an interesting question as it relates to adding a background image to a JPanel (or whichever component is best for what I'm trying to achieve. Hopefully I'll get some help here.) I have a large picture that I want to use as a background image …

Member Avatar for CoilFyzx
0
387
Member Avatar for jimoaks

Hello, I am having some trouble writing this java GUI. First in the win1, i cannot get the start and exit button to the bottom of the page along with the jlabel into the center. Next for win2 i cannot resize the "go here" button at the bottom of the …

0
299
Member Avatar for v3ga

I have a JLabel and a JPanel which both implements MouseClicked methods and I have added the JLabel to the JPanel but when the JLabel is clicked, the MouseClicked method of JPanel is invoked. How to fix this>??

Member Avatar for v3ga
0
152
Member Avatar for 117

Hello, I'm trying to make a JPanel with JFrame capabilities, such as resizing, and moving, Everything seems to work fine, altough there are minor flickering inside the JPanel, I have numeral repaints and I have a method called update(), which uses absolute position to arrange Containers and Components. Whenever the …

Member Avatar for 117
0
4K
Member Avatar for comSysStudent

I'm trying to get my JPanel (JFrame?) to resize itself to fit randomly drawn shapes. I have a shape superclass and right now I'm working with my line subclass. Everything is working fine except I can't figure out how to make the shapes fit the size of the JPanel. Should …

Member Avatar for comSysStudent
0
7K
Member Avatar for abyss776

I've been searching the internet for a way to specify the size of a component within a JPanel, but I haven't been able to find anything that has worked. The best answer I came across was to override the getPreferredSize(), getMaximumSize(), and getMinimumSize() methods of the component, but the component …

Member Avatar for abyss776
0
210
Member Avatar for mhariharasudan

Hi, I am a new Java Programmer.could you help me in resolving this. I am trying to created a JPanel withing a main JPanel. For the nested one, i have included Grid Layout and i am trying to add components to it dynamically. i.e i have added a combo box …

Member Avatar for mhariharasudan
0
1K
Member Avatar for powerdink

I need some help. I'm trying to create a number pad like a cellphone that captures user input by pressing buttons in a panel on the left and displaying what the user punches in the top panel. Then I have a clear button in the panel on the right to …

Member Avatar for JamesCherrill
0
185
Member Avatar for ecclesiastes3:1

Good Day... the problem is that the Jbutton is not displaying in my Jpanel. can you help me, this will help me a lot, Thanks Here's the code [CODE] import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URL; import javax.swing.JButton; import javax.swing.JOptionPane; public class GameBoard extends JPanel implements ActionListener { JButton …

Member Avatar for ecclesiastes3:1
0
293
Member Avatar for teo236

I want to redraw a JPanel while my program is running. Here's a fragment of my code: [CODE]public class Graph extends JPanel{ public void redrawSomething() { getGraphics().drawRect(15, 5, 20, 5); repaint(); }[/CODE] I tried to call "redrawSomething" but nothing happend. How do I fix it? Is something wrong?

Member Avatar for teo236
0
235
Member Avatar for guru_iyer

I am trying to change the background color of the JPanel every 3 seconds (3000 ms) when I click START button till I press STOP button. [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Random; class TimerBackground implements ActionListener { JFrame frame; JPanel panel; JButton btnStart; JButton btnRed; JButton btnGreen; …

Member Avatar for guru_iyer
0
1K
Member Avatar for SMITA6076

I have a [ICODE]JFrame[/ICODE] window to which I am trying to add 3 panels. One panel is for input (text areas and their labels which I already have arranged within the panel), one is for a set of buttons, and one is for output. I want the the input and …

Member Avatar for JamesCherrill
0
385
Member Avatar for musikluver4

I have a JFrame with 2 JPanels...my problem When I attach one of the JPanels to the JScrollPane object, it encompasses the whole JFrame, instead of just the JPanel I said to attach to. The scrollBar goes all the way up to the top of the JPanel I don't want …

Member Avatar for musikluver4
0
731
Member Avatar for DDirectJ

i'd like to ask how one can get rid of all the components in a JPanel (buttons, labels, comboboxes etc), so that you can add new components (at run time that is)

Member Avatar for DDirectJ
0
164
Member Avatar for Progr4mmer

I wanted to know if its possible to change the text of a JTextArea or JTextPanel from another method and if so how?

Member Avatar for Progr4mmer
0
194
Member Avatar for Taimoor Rana

I want to load an image for each different shoe and I'm using JLabel to help me do this. I put the image's path in the JLabel constructor but when the code runs, it doesn't display any image. Instead of an image, the image path is written. appreciate any help …

Member Avatar for ztini
0
241
Member Avatar for hauda67

Basically what I would to know is you have a button on one JPanel, and when the user clicks it, they are re-directed to the other JPanel. I would appreciate it if i could have some sort of hint or know about the overall structure of implementing this. Thanks,

Member Avatar for mangopearapples
0
122
Member Avatar for ajst

Hi, I'm trying to use JAVA GUI for first time. I've got a Jframe that when loaded adds a jpanel. the problem is it will not show any swing controls that get added to the jPanel. I'm using netbeans 6.9.1. any idea to why is happerning would be greatful [CODE] …

Member Avatar for JamesCherrill
0
3K
Member Avatar for leiger

I'm trying to list a bunch of buttons vertically, but am having problems even getting that much done. I'm pretty sure I have the scroll pane working (it just isn't being used yet so I can't test it). This is part of an assignment so I'd prefer not to post …

Member Avatar for leiger
0
2K
Member Avatar for Nicky4815

Hi, I'm working on a dissertation based around graph visualization. I need to make a GUI for my program but I am having trouble getting the JPanels to display what is required. My code so far: [code] //Class to create the GUI import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Component; import javax.swing.JFrame; …

Member Avatar for mr.george
0
129
Member Avatar for Ecliptical210

Hi guys, I'd really appreciate it if someone could look over my code and tell me why my JComboBox isn't working. I've got 3 Classes, 2 for the GUI, one for the standalone which the array is contained in. [CODE]import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JComponent; import javax.swing.SwingUtilities; import …

Member Avatar for javaAddict
0
153

The End.