From: irwan <ry...@tm...> - 2000-12-11 04:09:24
|
Hi all I'm newbie in jpython/jython. I would like to write a simple jython code within swing module that's include setBounds method. It seems only work for the first widget. In java u need to set setLayout to null but when i'm trying to do the same thing i get an error. Below is i simple code in jython that using setBound method which is only work for the first widget. That's mean only jL1 will effect and not (jL / jL2) frame=swing.JFrame("Data Extraction",visible=1) #a=java.awt.FlowLayout() #frame.contentPane.setLayout(a) exitMenu=swing.JMenu('File') fileItem1=swing.JMenuItem('Open',actionPerformed=action) exitMenu.add(fileItem1) exitItem1=swing.JMenuItem('Quit',actionPerformed=action) exitMenu.add(exitItem1) menuBar1=swing.JMenuBar() menuBar1.add(exitMenu) jL1=swing.JLabel("Extraction Method") jL1.setBounds(5,5,200,100) frame.contentPane.add(jL1) jL=swing.JLabel("Run Stored Procedure") jL.setBounds(5,20,200,100) frame.contentPane.add(jL) frame.setJMenuBar(menuBar1) #jT=swing.JTextField("00-MON-YY",10) #jT.setBounds(50,50,50,10) #frame.contentPane.add(jT) jL2=swing.JButton("Run ", actionPerformed=storcProc) jL2.setBounds(20,50,10,10) frame.contentPane.add(jL2) frame.setSize(300,200) frame.show() |