Bugzilla – Attachment 766 Details for
Bug 1274
Window mispositioned after resize in container
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test case to reproduce
TestBug.java (text/plain), 2.42 KB, created by
mbastian2
on 2015-12-04 22:03:29 CET
(
hide
)
Description:
Test case to reproduce
Filename:
MIME Type:
Creator:
mbastian2
Created:
2015-12-04 22:03:29 CET
Size:
2.42 KB
patch
obsolete
>package testbug; > >import com.jogamp.newt.awt.NewtCanvasAWT; >import com.jogamp.newt.opengl.GLWindow; >import com.jogamp.opengl.GLCapabilities; >import com.jogamp.opengl.GLProfile; >import java.awt.BorderLayout; >import java.awt.Color; >import java.awt.Dimension; >import java.awt.event.ActionEvent; >import java.awt.event.ActionListener; >import javax.swing.JButton; >import javax.swing.JFrame; >import javax.swing.JPanel; >import javax.swing.SwingUtilities; > >public class TestBug { > > public static void main(String[] args) { > new TestBug().run(); > } > > public void run() { > try { > // Create canvas > GLWindow glWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault())); > NewtCanvasAWT glCanvas = new NewtCanvasAWT(glWindow); > glWindow.addGLEventListener(new Gears()); > > // Create panel with canvs at center, hidden panel at south and button > // to open/close hidden panel > final JPanel toBeMadeVisiblePanel = new JPanel(); > toBeMadeVisiblePanel.setBackground(Color.GREEN); > toBeMadeVisiblePanel.setPreferredSize(new Dimension(100, 100)); > toBeMadeVisiblePanel.setVisible(false); > > final JPanel panel = new JPanel(); > final JButton button = new JButton("test"); > button.addActionListener(new ActionListener() { > @Override > public void actionPerformed(ActionEvent e) { > SwingUtilities.invokeLater(new Runnable() { > @Override > public void run() { > toBeMadeVisiblePanel.setVisible(!toBeMadeVisiblePanel.isVisible()); > } > }); > } > }); > > panel.setLayout(new BorderLayout()); > panel.add(button, BorderLayout.NORTH); > panel.add(toBeMadeVisiblePanel, BorderLayout.SOUTH); > panel.add(glCanvas, BorderLayout.CENTER); > > final JFrame jFrame1 = new JFrame("JFrame"); > jFrame1.setContentPane(panel); > SwingUtilities.invokeAndWait(new Runnable() { > @Override > public void run() { > jFrame1.setSize(1024, 768); > jFrame1.validate(); > jFrame1.setVisible(true); > } > }); > } catch (Exception ex) { > ex.printStackTrace(); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1274
: 766