Skip to content

AddingComponentListenerToProcessingWindow #469

Closed Answered by vsquared
vsquared asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the suggestion to try module mode. If we accept the default layout manager for JFrame and give up setting the bounds for components, whatever we place in that JFrame will automatically resize when the window is resized. I've added a few components to the original demo and created a pretty nice editor with functional 'File/open'.

import py5

from javax.swing import *
from java.awt import *
from javax.swing.event import *

_wndW = 700
_wndH = 700

def menuAction(event):
    if(event.getSource() == mItemOpen):
        fileChooser = JFileChooser()
        result = fileChooser.showOpenDialog(fileChooser)
        if(result == JFileChooser.APPROVE_OPTION):
            file_select = fi…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@vsquared
Comment options

Answer selected by villares
Comment options

You must be logged in to vote
8 replies
@vsquared
Comment options

@villares
Comment options

villares Jun 1, 2024
Collaborator

@vsquared
Comment options

@vsquared
Comment options

@villares
Comment options

villares Jun 2, 2024
Collaborator

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants